[BUG REPORTED] Camera Position doesnt work with Light Function

Can you elaborate on how its not working or share the context in which you are trying to use the the camera position node in a material? I just tested and verified and it appears to be working:

312579-cameraposition.gif

1 Like

Edit: Unreal Engine Issues and Bug Tracker (UE-99353)

Maybe this is a bug, but yeah. The Camera Position node when used in a light function, outputs seemingly nothing. I’ve done a manual workaround, by outputting the player camera position from a Blueprint to a Collection Parameter, and then the light function read from that Collection Parameter.
While this *works, its ineffective in editor. As it requires blueprints to be ticking, and requires the player camera. Are there any better solutions?

As a note, the same material color changes occur when moving the scene viewer camera around when not in play as well.

I’ve said it multiple times in my explanation. Light Function.

Make a material, set its Material Domain to Light Function. Then put this Material on any light source. The lightsource will output nothing, as the Camera Position node will be outputting nothing.

And so I had to make a workaround, which gets me Camera Position through other, less preferable means.

That is interesting, I was able to reproduce the same bug, I don’t know of another good working than what you have presented here. might want to report this one to them at https://www.unrealengine.com/en-US/support/report-a-bug

Thankyou, I have just a few moments ago. Ill report back on the status of it, if/when I can spot it. According to the email, they wont tell me the status. I’ve gotta search for it myself, and will see it in the search once they have finally reviewed it…

Ok, I did actually get an email response. And ofcourse responded with their requests.

Hopefully this gets patched in the next update or hotfix.

Awesome, nice followup, I’ve added my vote there!

Thankyou. And FYI for anyone coming across this and is curious, this is my use case.

World height limited, and Camera localized underwater caustics. One directional light, that handles both above and below water lighting. Deeper you go, the darker it gets.

It ofcourse has above and below exposure.