Home | Lehre | Videos | Texte | Vorträge | Software | Person | Impressum, Datenschutzerklärung | Blog
Level of Detail, Occlusion Culling
-
Level of Detail (LoD)
-
How to render more efficiently: If an object only appears small on screen
(either because it is small or because it's distant), render that
object with less precision, in particular the number of polygons may be
reduced. The level of detail [Detaillierungsgrad] should be appropriate
for the visible size.
-
Implementation
-
One possible way: Use objects with dynamic resolution, for instance spheres
with adjustable numbers of slices or subdivision surfaces with more or
less iterations of subdivision. Demos with Cinema 4D: animating the resolution;
controlling the resolution via a script.
-
Another way: Compute coarse versions of detailled objects (polygon reduction;
also used to convert high-resolution 3D models into a form more appropriate
for games or other real-time applications).
-
A closer look at polygon reduction
-
Typical method: Remove two triangles by collapsing one edge (hence: edge
collapse). Repeat as often as necessary. Begin with the triangles where
the edge collapse is like to introduce the least visual error. To this
end, sort the edges according to a corresponding criterion (Do neighbors
have similar normals? Is the area small? etc.).
-
Contained in Managed DirectX as SimplificationMesh. Demo: my contribution
to Direct ShaderX3
-
Polygon reduction with Cinema 4D and Maya; painting the "importance" in
Maya
-
Best currently known method: variational
shape approximation
-
Basic problem with LoD: On switching between different resolution, the
form and (even more!) the shading may change drastically: "Popping"
-
Culling [pflücken, aussuchen; Tiere töten, weil ihre Zahl
zu groß ist oder weil sie krank oder zur Zucht ungeeignet sind]
-
Another idea to optimize rendering: Ignore objects that are not visible
anyway or are only visible to a minimal degree..
-
Backface culling: ignore the back faces; causes problems with open
objects.
-
View frustum culling: ignore all objects that are completely outside
the viewing frustum [Sichtpyramidenstumpf]; may cause problems with shadows
and reflections of objects that lie outside the viewing frustum.
-
Occlusion culling: ignore objects that are hidden behind other objects
(that is: occluded by them)
-
Apply coarse but fast test; if in doubt prefer to render an object (conservative
strategy; one may also opt for a more aggressive strategy).
-
Fast occlusion tests yield only a potentially visible set (PVS)
of polygons and objects; typically, one renders this set completely.
-
A simple test is to check whether or not the bounding box of an object
would be visible. This is supported by many graphics cards: Render a 3D
scene from near to far (at least, try to). For every object render its
bounding box, but with writing to the RGB buffer disabled. Let the graphics
card count how many pixels would have been affected (occulsion query).
Demo with OpenGL. Problem: To know if we may savely discard an object,
we have to wait for the number of pixels to be returned from the graphics
card. Only sophisticated
programming techniques allow to prevent stalling [abwürgen, z.B. einen
Motor] the CPU and thus wasting computational power here.
-
Different method: Sort the objects into a hierarchical spatial structure
[hierarchische Raumstruktur] such as a BSP tree [BSP = binary space partitioning],
a quadtree, or an Octree to be able to quickly check occlusions.