View Full Version : Occlusion with transparent textures

09-25-2004, 10:12 AM
My scene contains a sky with a sun. I want to know if and how much the sun is occluded by clouds.
I render the sun as a simple 3d-billboard. Then i render a simple sky-dome with a texture applied which contains clouds but mostly empty (transparent) areas.
I have the absolute screen coordinates of my sun. So I need to know the texture's pixel which is being rendered at this point...but how?
Or do you see a different approach for this problem?

09-25-2004, 10:29 AM
Two of many options are ARB_occlusion query for the exact number of pixels, or rendering to a low resolution texture.

What hardware are you targeting?

09-25-2004, 11:55 AM
Ah... I just had a look at the occlusion_query extension and it's quite interesting...
They even say that it could replace depth-buffer reading (they're refering to lens-flares). Should i substitute my depth-buffer reading with this extension? What are the advantages?

I'm targeting at rather non-highend graphic-cards.

Thanks so far.

09-25-2004, 07:36 PM
If you are willing to wait one frame for your query result to return, the occlusion query method should be faster, I think. Flares aren't an exact science, so I think it's appropriate.