jit.gl.cubemap to gridshape to matrix?

Marigold Maripol's icon

Hi all -

I've adapted the jit.gl.cubemap example to include a matrixoutput of jit.gl.gridshape, so that I can manipulate the geometry in jit.gl.mesh. But sadly, the jit.gl.cubemap does not seem to work.

I feel like there is something important I am misunderstanding about textures here - if anyone has help to the problem, that would be great- but also, if there are any resources to better understand why this isn't working, I would be curious.

Thanks!

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

TFL's icon

It is not explicitely stated in the help file but the reason why the cubemap gets applied to the gridshape is because of its @texture cmap attribute. Because you use @matrixoutput 1, the gridshape is now only used to output matrices (more precisely a 12 planes matrix, including vertices position, normal map, texture coordinates and color).

The 3D object itself is now rendered by [jit.gl.mesh], so you need to pass the few rendering-related attributes from the gridshape to the mesh, which includes @lighting_enable 1 @smooth_shading 1 @texture cmap

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

Alternatively you could apply the cubemap through [jit.gl.pbr]:

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

Marigold Maripol's icon

Thank you - this helps tremendously.