jit.world no longer rendering sphere

Kieran Kehoe's icon

Can anyone tell me why my jit.render is no longer rendering a sphere as it was before. This is an edit on a delicious max tutorial that was working perfectly. Im unsure what ive done but its no longer rendering. Apologies for the messy code.
Thanks for any help!

shader-tutorial-03.maxpat
Max Patch

Matteo Marson's icon

Hi Kieran,

The problem with your patch is that there's no object drawing the sphere. You're using a jit.gl.gridshape (that should draw it), but with the attribute @matrixoutput 2; this makes jit.gl.gridshape stop drawing the sphere and output the geometry as a matrix.
This technique is used to apply further manipulation to the geometry.
The matrix then is plugged into a zl object, which implements many different functions, but 3D rendering is not one of them.
Look at this edit of the patch:

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

I plugged the matrix into a jit.gl.mesh object that draws the sphere again. I also attached a jit.gl.pbr object to shade the mesh.

Kieran Kehoe's icon

Thanks a lot!! I knew it would be something simple. Unfortunately as I am running max 7 at the moment the jit.gl.pbr object didnt work but this has resolved my issue and got me back to a point where I can work forward from! Thanks!

Matteo Marson's icon

Great to hear it worked! If jit.gl.pbr isn't available, switch to jit.gl.material; it will do the job

Kieran Kehoe's icon

Wow, crazy fx. One last question. Where is this rendering to? i want to make it fullscreen for projecting and also get rid of the bar at the top with the minimize and x.

Matteo Marson's icon

To answer your first question, the scene is rendered to a texture via the object jit.gl.node. Try to connect it to a jit.pwindow object, and you'll see the rendered image. Then, the texture (after further manipulation) is plugged into a jit.gl.videoplane, that displays it on screen (inside the jit.world window). I'd suggest checking out the help files of these objects to understand better how they work

To make the window fullscreen, you have three possibilities:
1) click on the window and then press "ESC" to enter and exit fullscreen mode
2) send to jit.world the message "fullscreen 1", to enter full screen and "fullscreen 0" to exit.
3) set manually the attributes of jit.world, in particular
- "border 0" to remove the top bar
- "floating 1", to keep the window always on top
- "rect x0 y0 x1 y1" to decide the extent and positioning of the window; x0 y0 is the position (in pixels) of the top-left corner of the window, and x1 y1 s the position of the bottom-right one

MakePatchesNotWar's icon

"1) click on the window and then press "ESC" to enter and exit fullscreen mode"

No way, when was this implemented? No more key into sel32 into toggle into fullsreen$1!

Kieran Kehoe's icon

Mucho gracias, I'm understanding more and more each day. Thanks again.