How to obtail value of z-buffer at some location on screen?
I draw all kind of 3d object. At some time, I need to know what value Z-buffer has, lets say on (x,y) point on screen. If it will be 1.0, I will draw something there, otherwise not.
How to do this in fast way?
A couple of questions:
Are you doing hardware or software rendering?
Do you care about transparency?
Do you want to query a hardware Z-buffer, and if so, do you care about it working with tile-based rendering architectures?
RomSteady - I play games for a living.
Are you doing hardware or software rendering?
Do you care about transparency?
Do you want to query a hardware Z-buffer, and if so, do you care about it working with tile-based rendering architectures?
RomSteady - I play games for a living.
hardware rendering
transparency: not when i want to draw this stuff, it is at the end of drawing, otherwise yes
I basicaly want to know, what was rendered on point (300,200). I would like to have 0.0f - something very close, 1.0f - something very far.
This is needed for lens flares. If something is blocking sun, i dont want to render flares.
transparency: not when i want to draw this stuff, it is at the end of drawing, otherwise yes
I basicaly want to know, what was rendered on point (300,200). I would like to have 0.0f - something very close, 1.0f - something very far.
This is needed for lens flares. If something is blocking sun, i dont want to render flares.
There are lockable Z-Buffer formats, but as far as I know, lockable z-buffers aren''t widely supported, and it''s slow. Z-buffers are mainly uni-directional (==write-only).
Maybe you should try occlusion culling for the sun with your geometry?
Cheers,
Muhammad Haggag
Maybe you should try occlusion culling for the sun with your geometry?
Cheers,
Muhammad Haggag
I think he means you should try casting a ray from your viewpoint to your "lens-flared" light source. If the ray hits something else, the light source is occluded and would not flare.
That way would work regardless of architecture, because tile-based rendering chipsets like PowerVR''s don''t have Z-buffer information until after the scene renders.
RomSteady - I play games for a living.
That way would work regardless of architecture, because tile-based rendering chipsets like PowerVR''s don''t have Z-buffer information until after the scene renders.
RomSteady - I play games for a living.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement