Screendoor transparency
Hi,
I want to render transparent objects in my scene, but sorting is out of the question. Does anyone know of any methods to draw transparent objects without sorting the entire scene back-to-the-front?
I was looking into the Screendoor Transparancy technique, but couldn't find much information on it. Does anyone know how it works?
I think I have to do something with GL_POLYGON_STIPPLE but don't know what exactly.
Thanks for your help,
Jeroen
A simple way is to use two passes;
pass 1: disable the color buffer, enable depth buffer, draw all geometry
pass 2: enable the color buffer, disable depth writing, then draw all geometry agian
This isn't perfect, but it is quick to implement [grin]
pass 1: disable the color buffer, enable depth buffer, draw all geometry
pass 2: enable the color buffer, disable depth writing, then draw all geometry agian
This isn't perfect, but it is quick to implement [grin]
Do you mean I have to draw the WHOLE scene geometry twice, or just the transparent geometry? If it's the latter, it seems like a viable solution to me.
You could do it like that, first draw all solid geometry normally, then draw the transparencies in two passes, I don't see any reason why it wouldn't work.
I just rendered all my geometry in two passes when I used the technique for a small test app, so I don't know for sure.
I just rendered all my geometry in two passes when I used the technique for a small test app, so I don't know for sure.
Just checking (because no one said anything)
This '2-pass' trick of yours works with the Blend() function, right?
I've been having the same problem. But I couldn't find a way. I sort of had the same idea, but I didn't know how I was souppose to go about it.
This '2-pass' trick of yours works with the Blend() function, right?
I've been having the same problem. But I couldn't find a way. I sort of had the same idea, but I didn't know how I was souppose to go about it.
nope, doesn't work -_-'
the texture is drawn to the right depth, but although it's transparent you still can't see what's behind it due to the quad drawing in the 1st pass.
Last check, is there really no way to draw a transparet or masked texture without 'Disable()ing' the 'DEPTH_TEST'???
the texture is drawn to the right depth, but although it's transparent you still can't see what's behind it due to the quad drawing in the 1st pass.
Last check, is there really no way to draw a transparet or masked texture without 'Disable()ing' the 'DEPTH_TEST'???
Quote:Original post by Farraj
Last check, is there really no way to draw a transparet or masked texture without 'Disable()ing' the 'DEPTH_TEST'???
Instead of disabling the entire depth test, just try disabling writing to the depth buffer : glDepthMask(GL_FALSE)
I just finish googling 'glDepthMask()'
I never knew that there was such a thing :D
It draws the transparnt object naturally like any other 3D object but without saving it's current depth in the depth buffer (z-puffer??)
Now that's what I call using your head. :P
Although, I still don't understand why use only GL_FALSE to change the depthmask from one state to another and back?
Oh well :P
thanks Specchum.
I never knew that there was such a thing :D
It draws the transparnt object naturally like any other 3D object but without saving it's current depth in the depth buffer (z-puffer??)
Now that's what I call using your head. :P
Although, I still don't understand why use only GL_FALSE to change the depthmask from one state to another and back?
Oh well :P
thanks Specchum.
Just disabling DepthMask isn't going to get you the results you're looking for; if you rotate around a bit, you'll quickly find solutions where the draw-order breaks up.
Your best bet is to draw opaque and alpha objects in seperate passes, sorting alpha objects by depth, and disabling Z-write on them when rendering.
Allan
Your best bet is to draw opaque and alpha objects in seperate passes, sorting alpha objects by depth, and disabling Z-write on them when rendering.
Allan
Quote:Original post by godmodderThere's no need to sort the entire scene. __ODIN__ has it right, I'll explain in a (very) little more detail.
...
Does anyone know of any methods to draw transparent objects without sorting the entire scene back-to-the-front?
...
- Enable depth testing and depth writing - Render all opaque objects (order doesn't matter here) - Disable depth writing - Render all transparent objects from back to front
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement