:allow_comments: False .. _doc_dev_rendering: Rendering ========= This section will give a general overview over the OpenGL rendering done in Met.3D. The render pipeline in Met.3D is implemented in `MSceneViewGLWidget`. .. uml:: :caption: Render pipeline as implemented in `MSceneViewGLWidget`. :align: center (*) --> "Multi-sampled cascaded shadow pass" --> "DVR volume lighting pass" --> "Multi-sampled 3-D actors pass" --> "Multi-sampled DVR pass" --> "Multisample resolve" If "Use FSR upscaling" then -->[true] "FSR upscaling" --> "2-D UI actors pass" else -->[false] "2-D UI actors pass" Endif --> "Label pass" --> "Present to viewport" --> (*) The first step in the render pipeline renders the shadows of all 3-D actors in a multi-sampled depth-only pass. This is done using cascaded shadow maps with three cascades. The whole process is outlined in :ref:`shadow-mapping`. Then, if present, the volumetric light-map of the :ref:`raycaster-actor` is updated utilizing a compute shader. The next step renders all 3-D actors into a multi-sampled framebuffer. This is done at an internal resolution, which does not always correspond to the viewport's resolution. For example, the user can force to use a fixed render resolution or use upscaling to improve performance. The previously rendered shadow maps are also applied on a per-actor basis. The :ref:`raycaster-actor` will be rendered after all other actors have been rendered to the scene. This is necessary, as their rays have to stop when encountering normal scene geometry. These first render steps use multi-sampling to facilitate our :ref:`oit` rendering. After all actors are rendered, the multi-sampled framebuffer will be resolved for further processing. If the user enabled upscaling, a compute shader will run FSR 1.0 on the resolved color-buffer. The result of the upscaling will then be rendered onto a framebuffer with the target resolution. This is either a fixed render resolution defined by the user or the viewport resolution. If no upscaling is used, the resolved color-buffer will be rendered onto the framebuffer in the target resolution directly. In both cases, the resolved depth-buffer is rendered onto the framebuffer as-is, for depth testing of labels. This framebuffer is then used to render all 2-D UI actors onto the 3-D scene. This can be transfer functions, images or other 2-D elements in the scene. At last, the labels in the scene are drawn. This can be done with depth-testing enabled, which places them into the 3-D scene, or without. The resulting color buffer will then be rendered onto the viewport. This has to be done, as the viewport's resolution can still be different to the target resolution specified by the user. .. toctree:: :maxdepth: 1 :caption: Contents: shadow_mapping oit coordinate_spaces