Skip to main content
spelling (tessellation)
Source Link
sam hocevar
  • 24k
  • 2
  • 65
  • 95

You can just check to see if your worldspace camera position is on the negative half-space of the the plane of the triangle you are considering (dot product of Normal and camera position and then a comparison to the plane constant).

This can be done hierarchically to be efficient i.e., you group triangle with similar normals together - effectively the normals all fall within some reasonably small cone. Then a test against this cone (effectively a dot product with a more conservative constant), can reject or accept many triangles at once.

In general, it is best to let the hardware do it - the overhead of dynamically altering your index or vertex buffers (when non-indexed) and the coding effort required likely isn't worth it.

Note that in your tesselationtessellation example, even if the pre-tesselatedtessellated triangle or quad is invisible a tesselatedtessellated AND displaced mesh may still have front facing triangles, so be careful. :-)

You can just check to see if your worldspace camera position is on the negative half-space of the the plane of the triangle you are considering (dot product of Normal and camera position and then a comparison to the plane constant).

This can be done hierarchically to be efficient i.e., you group triangle with similar normals together - effectively the normals all fall within some reasonably small cone. Then a test against this cone (effectively a dot product with a more conservative constant), can reject or accept many triangles at once.

In general, it is best to let the hardware do it - the overhead of dynamically altering your index or vertex buffers (when non-indexed) and the coding effort required likely isn't worth it.

Note that in your tesselation example, even if the pre-tesselated triangle or quad is invisible a tesselated AND displaced mesh may still have front facing triangles, so be careful. :-)

You can just check to see if your worldspace camera position is on the negative half-space of the the plane of the triangle you are considering (dot product of Normal and camera position and then a comparison to the plane constant).

This can be done hierarchically to be efficient i.e., you group triangle with similar normals together - effectively the normals all fall within some reasonably small cone. Then a test against this cone (effectively a dot product with a more conservative constant), can reject or accept many triangles at once.

In general, it is best to let the hardware do it - the overhead of dynamically altering your index or vertex buffers (when non-indexed) and the coding effort required likely isn't worth it.

Note that in your tessellation example, even if the pre-tessellated triangle or quad is invisible a tessellated AND displaced mesh may still have front facing triangles, so be careful. :-)

Source Link
Crowley9
  • 688
  • 4
  • 5

You can just check to see if your worldspace camera position is on the negative half-space of the the plane of the triangle you are considering (dot product of Normal and camera position and then a comparison to the plane constant).

This can be done hierarchically to be efficient i.e., you group triangle with similar normals together - effectively the normals all fall within some reasonably small cone. Then a test against this cone (effectively a dot product with a more conservative constant), can reject or accept many triangles at once.

In general, it is best to let the hardware do it - the overhead of dynamically altering your index or vertex buffers (when non-indexed) and the coding effort required likely isn't worth it.

Note that in your tesselation example, even if the pre-tesselated triangle or quad is invisible a tesselated AND displaced mesh may still have front facing triangles, so be careful. :-)