Binding an ENV to Camera

Hello all,
I am relatively new to the field and am currently working on my first webgl project.
I would like to take the approach of binding an environment (kind of rim light) to the camera. Consequently, each time the camera is set, the object should be illuminated with a light from behind.

I am unsure if you can really subordinate an ENV to the camera transformations or bind a single area light to it.

Looking forward to your tips!

Best regards,

I am totally unsure of what you are trying to achieve :frowning:

Do you want to attach a light to the camera which is as simple as light.parent = camera or Do you want to attach a PBR environment to the camera which in this case requires applying a rotation to the environment Texture ?

1 Like

Hi there and welcome! Sounds like you are talking about a parent with an offset (like sebavan) suggestion. But can you explain the ENV part more? :slight_smile:

1 Like

I actually did that while trying to solve the Oculus camera shake problem. Rotation did not work, because an environment rotates around 0, 0, 0. Reflections moved. Now with a camera moving, they should move on their own, but getting that to look reasonable far from the origin might not be feasible.


Thanks for the quick responses!

The goal is to lighten an object more specifically and to maintain this illumination regardless of the viewing position. Either with single lights or with an environment / HDRI - so the focus of the camera is always on the object and the position of the camera will not be changed.

Regarding the individual lights, I think a parent with an offset will probably lead to the goal, but the distance to the illuminated object must always be identical.

The environment idea is pretty similar, just wondering if it’s technically possible? Unfortunately, I’m totally stumped on that.

I’ll try to work into that, hope I get it solved somehow with a single light and a constant offset to the object. Environment would have a few advantages for me, but perhaps also makes more sense at a later stage.

I guess in your case the env rotation might be the simplest you should definitely try it ?

Yeah, lights do not really distinguish a front or a backside of a mesh. Env is probably the only way.

I am actually doing that (not intentionally), except that since this tool I built is intended for XR, I rotate the subject not the camera.

Here is a character from front with their back to the sun. The red dot is the origin of the scene. While I think it would be weird to rotate the light source, having the subject at the origin is probably going to be a must. (Taken from a desktop)

There is the character with the sun at their side, from both sides.

This is done using the flower road env. The sun is fairly high, about at 11am, and really strong.