jit.gl.sketch drawobject command is broken in max 6

Nov 11, 2011 at 8:26am

jit.gl.sketch drawobject command is broken in max 6

Both drawobject 0 and drawobject 1 have some big problems in Max6.

While I’d love to leave jit.gl.sketch behind and move on to all the new jit.gl objects in Max6, for now I need to be able to run my existing patches, and almost all of them are deeply dependent on the nested structure facilitated by the drawobject command in jit.gl.sketch.

Until this gets fixed, I’m stuck.

Compare how the attached patch runs in 5 vs 6.

– Pasted Max Patch, click to expand. –
#59955
Nov 11, 2011 at 1:05pm

+1
All my drawing structures relies on drawobject in jit.gl.sketch.

And could we get a frustum parameter in jit.gl.camera?

#215855
Nov 11, 2011 at 3:49pm

curses! Apologies for not having this fixed in 6.0.1. I’m on it.

#215856
Nov 11, 2011 at 4:22pm

Incremental Object Update?

#215857
Nov 11, 2011 at 4:30pm

It’s a Jitter thing, not a sketch thing so any updates will have to wait for 6.0.2. Thanks for your patience.

#215858
Nov 11, 2011 at 9:30pm

One thing to note Perry is that the redness of the box when lighting is turned on is a bit of a fluke. This behavior is dependent on GL_COLOR_MATERIAL being enabled. In Max6 jit.gl.gridshape uses a jit.gl.mesh internally, which calls glEnable/glDisable on GL_COLOR_MATERIAL, causing your glcolor 1 0 0 1 not to set the diffuse material component. The fact that this is on in Max5 is by a fluke of the default state of the OpenGL context. To get this behavior in a more robust manner, set ‘glenable color_material’ as one of the command to sketch. In any case, I’ve set Max6 gridshape to follow what Max5 gridshape does now, so this will be in 6.0.2.

#215859
Nov 11, 2011 at 11:15pm

jit.gl.camera @colormask and @frustum are in the next release, so hopefully you will be free to move from jit.gl.sketch if you want

#215860
Nov 12, 2011 at 12:41pm

:) for frustum

is there an existing (planed) jit.gl.sketch command for jit.gl.material and jit.gl.light?
like:
glbindtexture tex_name …
drawobject obj_name …

working with stereoscopy, I bind a different texture to the same object in 2 parallel command list.
I don’t think it’s possible with 2 cameras … no? or i will need to have 2 identical objects with 2 materials…
So, usind jit.gl.sketch, I’ve got to maintain a long dynamic sublist command for each lights.
Calling a jit.gl.material or jit.gl.light will be great..

#215861
Nov 12, 2011 at 10:03pm

Thanks Wesley – can’t wait for 6.0.2

Something’s definitely wrong with glcolor inside sketch whenever drawobject is used – I think I understand what you’re saying about color_material, but setting ‘glenable color_material’ (or ‘gldisable color_material’) doesn’t seem to change anything –

Here’s a clearer example of the problem:

– Pasted Max Patch, click to expand. –
#215862
Nov 12, 2011 at 11:33pm

It has an effect for me. You have to be careful where you put it in the list. It has to come after drawobject:

reset, glclear, glcolor 1 0 0 1, gltranslate -3 0 -5, cube 1 1, glcolor 0 1 0 1, gltranslate 3 0 0, drawobject cronk $1, glenable color_material, glcolor 0 0 1 1, gltranslate 3 0 0, cube 1 1

Incidentally, everything looks good for 6.0.2 following what your comments say should be happening. You have the best patches BTW. very clear!

#215863
Nov 13, 2011 at 12:18am

OK, I see now.

So since ‘glenable color_material’ doesn’t have any effect if it’s put before the drawobject command, it’s almost as if drawobject includes a implicit ‘gldisable color_material’ command. This seems a little counterintuitive, or maybe I’m missing something?

#215864
Nov 13, 2011 at 12:32am

” it’s almost as if drawobject includes a implicit ‘gldisable color_material’ command.”

That’s exactly the difference between Max5 and Max6 because of the change with the gridshape using a mesh internally.

#215865

You must be logged in to reply to this topic.