v2.0.0
Loading...
Searching...
No Matches
brainrenderer.h File Reference

Qt-RHI scene renderer: shader pipelines, lighting, dual render targets and per-frame draw orchestration for disp3D. More...

#include "../disp3D_global.h"
#include "../core/rendertypes.h"
#include <QMatrix4x4>
#include <QVector3D>
#include <memory>
Include dependency graph for brainrenderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  DISP3DLIB::BrainRenderer
 Qt RHI-based 3-D renderer managing scene objects, lighting, camera, and render pipeline for brain visualization. More...
struct  DISP3DLIB::BrainRenderer::SceneData
 Aggregated GPU resources and render state for the 3-D brain visualization scene. More...

Namespaces

namespace  DISP3DLIB
 3-D brain visualisation using the Qt RHI rendering backend.

Detailed Description

Qt-RHI scene renderer: shader pipelines, lighting, dual render targets and per-frame draw orchestration for disp3D.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

BrainRenderer is the only object in disp3D that talks directly to QRhi. It creates the shader pipelines for every DISP3DLIB::ShaderMode (Standard Phong, Holographic, Anatomical, Dipole arrows, XRay, ShowNormals), allocates the dual rtClear / rtPreserve render targets needed for the multi-pass cortex + overlay composition, and issues per-frame beginPass / drawIndexed calls for every visible scene object.

The renderer packs camera matrices, light direction, viewport, scissor and the active overlay mode into one DISP3DLIB::BrainRenderer::SceneData uniform block per draw, which keeps the WebGL backend happy (Qt RHI on WebGL cannot rebind state mid-pass).

All scene objects (DISP3DLIB::BrainSurface, DISP3DLIB::DipoleObject, DISP3DLIB::NetworkObject, DISP3DLIB::VideoOverlay) are accepted through opaque pointers so the renderer never pulls in the heavy headers of the modalities it draws.

Definition in file brainrenderer.h.