Apply choice of textures to object upon which shadows are cast
I am new to shadows and lighting in Jitter. My goal is to be able to apply a choice of textures to an object upon which other objects cast shadows. I need to be able to do this without directly connecting the texture of choice to the first inlet of jit.gl.material, as my textures are generated in another subpatch, and there are a lot of them.
I am trying to figure out how to attach something to jit.gl.material that will be the texture of my choice, while remaining in GL world. I feel like I am missing something simple.
You can send messages to jit.gl.material like e.g. "diffuse_texture t1" or "diffuse_texture t2".
Bang these messages to change the texture to be applied to the plane or use [prepend].
Have a look at the reference of jit.gl.material - there are several texture targets available like
jit_gl_texture
heightmap_texture etc.
If you use another patch to create your textures make sure all textures and world objects belong to the same rendering context. This can be assured by explicitly naming the context in all objects e.g. [jit.world myWorld], [jit.gl.gridshape myWorld] etc.
Awesome, thank you! Works perfectly.