culling meshes across mulitple layers

Started by
-1 comments, last by rgc183 8 years, 2 months ago

I am implementing foveated rendering. My FBO is divided into 2 layers which are concentric. First layer covers 1/3 of Framebuffer whereas second one covers rest of the screen. Now I want to avoid to render meshes in outer layer which are already in inner layer. I have implemented following culling algorithm which is only concerned with culling between the layers:

  1. I create a rectangles with min and max corner from the radius of 2 layers. Now these coordinates are in NDC.
  2. I have min and max corner of each mesh in local coordinate system. so I transform them into NDC using:

    vec4 min=mvp * vec4(min_corner,1.0); min=min.xyzw/min.w;

  3. I create bounding box using min and max corners.

  4. Check whether 2 rectangles overlap or not.

Now, when I transform into clip space, the x or y coordinates of min are sometimes greater than max corner. Same issue occurs when I divide them by w. Whats going wrong here?

This topic is closed to new replies.

Advertisement