Transparency jit.gl.model - jit.gl.gridshape

    Jitterbeginner

    Vincenzo Perna
    Aug 21 2023 | 10:11 am
    Hi, I've already searched through other topics, but I didn't find a complete answer to my problem. I'm creating a project in which 3D objects must appear alternately, but I can't manage the transparency of the objects jit.gl.model and jit.gl.gridshape in any way. Ideas?

    • Rob Ramirez's icon
      Rob Ramirez
      Aug 21 2023 | 2:24 pm
      transparency requires @blend_enable 1 and @depth_enable 0 on the transparent objects. you likely want to set @layer to some value higher than the default of 0 so they draw last. You can then control opacity with the alpha value of the color attribute. Post a patch if that's not working.
      A bit more info on this found here: https://docs.cycling74.com/max8/vignettes/jitter_layering#Blending
      Share
    • Vincenzo Perna's icon
      Vincenzo Perna's icon
      Vincenzo Perna
      Aug 21 2023 | 4:31 pm
      With jit.gl.gridshape it works, but applying a texture on the object when I rotate it on the y axis changes the size of the texture, is it possible to dynamically manage the alpha of the color attribute?
      On the jit.gl.model object it doesn't seem to work, applying the attributes @blend_enable 1 and @depth_enable 0 there is also a loss of samples of the 3Ds object that is loaded inside.
      Project jitter.maxpat
      maxpat 11.08 KB
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Aug 22 2023 | 2:52 pm
      Ok with jit.gl.material attached to a jit.gl.model it's a bit more complicated. First for transparency with jit.gl.material you need to zero out the alpha value of all the material color components (mat_specular, etc) and then you can use mat_diffuse alpha to adjust overall transparency.
      And when using with jit.gl.model to override the model file's material, you must set @material_mode 0. You may also want to use @cull_face 3 which will automatically draw back faces before front faces, which is useful for drawing shapes with transparency.
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
    • Vincenzo Perna's icon
      Vincenzo Perna's icon
      Vincenzo Perna
      Aug 23 2023 | 7:30 pm
      Thank you, you solved the previous problems, I have another question: If I add a background with jit.gl.environment, managing the alpha of the 3D objects obviously the layer of the object superimposed on the background remains, even when the alpha value is 0. Is there any way to not make this happen? That is, I would like the object to become totally transparent.
    • Rob Ramirez's icon
      Rob Ramirez's icon
      Rob Ramirez
      Aug 25 2023 | 2:57 pm
      again, post a patch that shows what you are seeing and we'll do our best.
    • Vincenzo Perna's icon
      Vincenzo Perna's icon
      Vincenzo Perna
      Aug 25 2023 | 4:06 pm
      Here is an example patch.