shadows jit.gl.multiple

michelez's icon

Hello folks,
I have objects moving in a sphere and I want shadows projected onto the inner walls of the sphere @cull_face 2, I achieved most of what I want (see patch) with one object in the sphere. Now I would like to have a jit.gl.multiple instead of a single object. If I do that sadly only one shadow shows up

. I know I could use a camera @capture 1 to create reflections but I was trying to avoid that (too expensive). Any ideas?

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

Pedro Santos's icon

Hi, Michelez. Missing patcher, try copy/paste again.
Anyway, giving the nature of jit.gl.multiple, which is essentially drawing an object multiple times, it's probably doesn't support shadows...

michelez's icon

here it is

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

I think you are right, so I am stuck with camera capture?

Rob Ramirez's icon

jit.gl.multiple supports shadows. it's demonstrated in the lights.shadows.maxpat example

Pedro Santos's icon

I stand corrected, I just noticed it... great!
The trick is to connect jit.gl.material to jit.gl.multiple, not the actual object.

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

Rob Ramirez's icon

ah yes good point. there's always a trick!

michelez's icon

Thanks for this!

dunk's icon

Hi there. Resurrecting this old thread. Struggling to deconstruct the lights.shadows.maxpat example patch — trying to retain colour and shadows from jit.gl.material when using jit.gl.multiple. Connecting jit.gl.material directly to jit.gl.multiple giving no results. No doubt I'm missing somethig glaringling obvious - apols in advance.

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

dunk's icon

Aha. The jit.gl.material must be connected directly to the jit.gl.multiple object without the use of a jit.gl.node.

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

dunk's icon

Which begs the question: In there a way to connect jit.gl.material to a node that is connected to jit.gl.multiple and retain shadows etc.?

TFL's icon

The patch in your previous post doesn't open/isn't valid.

Seems like your issue came from forcing @automatic to be enabled for the gridshape attached to [jit.gl.multiple]. And not sure why you need [jit.gl.node] at all in your case:

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

But nothing prevents you from having your gridshape + multiple as part of a node if you want (the only thing I did here was to add the [jit.gl.node] and attach it to [jit.gl.multiple]):

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

EDIT: to add up to this, as far as I know it doesn't make sense to apply a material to a node. [jit.gl.material] and [jit.gl.pbr] are basically shaders that can only be attached to geometry ([jit.gl.mesh], [jit.gl.gridshape], [jit.gl.model], [jit.gl.plato], etc.) , or a [jit.gl.multiple] duplicating geometry. But a node is more like a sub-rendering context.