set light_position in jit.world

T. A. Gambarotto's icon

How do I set light_position in jit.world? It does not accept it as an attribute. I tried adding jit.render to the patch, but Max crashed when I started jit.world.

Martin Beck's icon

Note: The effect of position change is not always visible.
Type point shows most intuitive response.

Max Patch
Copy patch and select New From Clipboard in Max.

https://stackoverflow.com/questions/16406861/difference-between-positioned-and-direct-light-in-c-opengl

T. A. Gambarotto's icon

Thank you for your detailed response. Let me clarify. When you use either jit.render or jit.world, a single light source is included without explicitly specifying. With jit.render, that source is moved with the light_position attribute:

Max Patch
Copy patch and select New From Clipboard in Max.

What is the equivalent in jit.world?

Max Patch
Copy patch and select New From Clipboard in Max.

T. A. Gambarotto's icon

Martin, in your example, when I disable both light sources, there is an implicitly declared light source still operating; but if I enable one of the explicit sources, the implicitly declared source disappears. So this might be my solution, but it would still be good to understand how to manipulate the implicit source.

Martin Beck's icon

I have no experience with the light_position attribute of jit.gl.render.
I would recommend using jit.world with explicitly declared light sources. (Adding one of them to a world will disable the default light.)
The light type "directional" may not show changes to all positions as far as I understand the physics behind it.

For an example of lights you might also see the Jitter sneak peak video at around 2:12

T. A. Gambarotto's icon

Ah, the sendrender message eluded me while I was searching for the answer.

All of this is very useful, thank you both!