lehnertu / xwing2

calculation of potential flow around model airplanes
GNU General Public License v2.0
0 stars 0 forks source link

3D rendering depth #3

Open lehnertu opened 8 years ago

lehnertu commented 8 years ago

Some parts are hidden by others even though they are in front of those.

lehnertu commented 8 years ago

tried to pipe the mesh through vtkDepthSortPolyData. It works, but the user interaction becomes extremely slow and there is still a problem with the output from different actors (i.e. mesh and wake) to be intermangled.

lehnertu commented 8 years ago

from VTK wiki: Correctly rendering translucent geometry with OpenGL-functionality in the background (as in the case of VTK) requires non-intersecting polygons and depth-sorted traversal. In general these requirements are not satisfied as the inherent order of scene traversal is object-based. Using a method, namely depth peeling, presented by NVIDIA in 2001 [1], shadow mapping (multi-pass rendering) in conjunction with alpha test can be consulted to achieve correct blending of the rendered objects in the frame buffer.

VTK implements this feature since November 2006 as described in the VTK WIKI (Francois Bertel). Unfortunately depth peeling has several OpenGL extension, context and driver requirements (but also runs on Mesa) which restrict the approach's usage to modern GPUs. Usually this feature slows down the rendering process depending on the configuration (occlusion ratio and maximum number of iterative peels).

However if depth peeling is not available on a certain machine, depth sorting can be accomplished on the CPU using vktDepthSortPolyData. This is usually much slower than the GPU-implementation and furthermore brings additional restrictions with it (e.g. poly data must be merged within one set).