jit.gl - quickest/easiest way to enable transparency?
Essentially I'm sending midi info via matrices into a jit.gl.mesh. I want the velocity of a note to control the alpha value. I think I'm sending the right values, but there is an attribute or parameter that I have to toggle to make light render transparent textures in the jit.world?
I'm sending RGBA / ARGB matrix (tried both) into the color inlet of jit.gl.mesh (also sending a seperate vertex matrix. The position and colour is working, just not transparency)
Hi Gavin,
Try with [ jit.gl.mesh @blend_enable 1 @depth_enable 0 ]
Hi. Here's an example.
thanks to you both! It always seems to be something like this with me and max haha, the simplest solutions hold me up the most.
Aaaand as always with Max, one roadblock cleared, another arrives haha. It seems I'm going to have to dig into the depth modes or something - transparency works, but if I switch of depth enable for all of my 3d objects something "pops through" and if I try various depth enabled/disabled combos, various other bits pop through... with everything at default or everything at 0, and every other combination I can come up with, it always seems like at least 1 object is ignoring transparent objects in front of it (ie a ball under a blue glass table is rendering as though there is no glass in a perfectly ball-encompassing circle)
You can probably use depth_enable 1 if you intend to have the expected order of drawing the scene objects. With depth_enable 0, you have to specifiy the drawing order manually, using the @layer "x" attribute on each object (with lower numbers staying below and higher numbers being drawn above other objects).
We don't currently provide built-in solutions for order independent transparency. Basically all transparent objects should be drawn on top of opaque, have @blend_enable 1 and either @depth_enable 0 or @depth_write 0 (depth_write is useful if wanting to depth blend transparent objects with opaque objects). @blend add instead of the default of alphablend may work in your case (hard to say more without a patch). Experimenting with the values of @blend_mode might give more desirable results.