Forums > Jitter

blend mode, alpha, &

Feb 04 2013 | 3:18 am

hi all-
i’m reposting a similar patch to one of the past posted re: how to use alpha channels to create transparency in GL.
i’m noticed that certain faces/angles of the grid shape seem to be non-transparent and i’m not sure why, nor am i sure how to rectify this..
any thoughts?

  1. AlphaDemo.maxpat
Feb 04 2013 | 8:28 pm

disable @depth_enable

Feb 04 2013 | 10:15 pm

Thanks Rob!

Feb 04 2013 | 10:42 pm

Is there another facet to this that I’m not considering? It seems like there is some other form of distortion when the object is rotating…

Feb 05 2013 | 6:50 pm

if you want to draw a gridshape with transparency and back-facing polygons, your best bet is to create two identical gridshapes, set @cull_face 1 on one and @cull_face 2 on the other.
this will make one only draw front-facing polygons, and the other only draw back-facing.
you can then use the layer attribute to force the back-facing one to draw first.

-- Pasted Max Patch, click to expand. --

Feb 05 2013 | 10:22 pm

Rob, if i disable the depth_enable, then if i add another object to the scene then one will cover the other independently of their Z position…

i had problems with this already… do i make something wrong, or if an object’s depth_enable is off then the only way i can place it to it’s righ place (behind another one or the camera side) if i change the layer depending on postion every render?

thanx in advance!


Feb 06 2013 | 12:02 am

Hey, fwiw setting depth_enable to 1 in Rob’s example seems to give a satisfying transparency. I’m curious about this as well, i want to have a scene with several openGL objects, some of which should allow to partially see objects behind them. Is that the way to go ? With a ?

Feb 06 2013 | 12:24 am

So, it seems indeed to be the way to go – feed a matrix with a minimized alpha channel to a texture, which is to be applied then.

Viewing 8 posts - 1 through 8 (of 8 total)

Forums > Jitter