3d - Screen space bounding box computation in OpenGL -
I am trying to apply the deferred rendering method of the tile and now I'm stuck. I am computing the minimum / maximum depth for each tile (32x32) and I am storing it in texture. Then I want to represent the boundary bounding box of the screen to the left bottom and the top right corner for every point (region) (see the picture from my app) in my scene. With minimum / maximum depth, it will be used to check whether the light affects the actual tile.
The problem is not how to do it, any ideas, source code or exact mathematics?
Update The screen space is basically a 2D unit, so think of a boundary rectangle instead of a bound box. Here's an easy way to calculate: Use a more streamlined method for a point light source To calculate a screen-space bounding recomp May be new. We calculate four planes that pass through the camera position and are the tangents of light (light radius) of light. With the image plane, we give 4 lines on the plane to the horizons of each tangent plane. These lines define the resulting bounding rectangle. See this article for math details:
Comments
Post a Comment