MeshLib C++ Docs
Loading...
Searching...
No Matches
MRRenderModelParameters.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace MR
6{
7
10{
11public:
12 TransparencyMode() = default;
13 TransparencyMode( bool alphaSort ) :alphaSort_{ alphaSort }
14 {
15 }
16 TransparencyMode( unsigned bgDepthTexId, unsigned fgColorTexId, unsigned fgDepthTexId ) :
17 bgDepthTexId_{ bgDepthTexId },
18 fgColorTexId_{ fgColorTexId },
19 fgDepthTexId_{ fgDepthTexId }
20 {
21 }
22 bool isAlphaSortEnabled() const { return alphaSort_; }
23 bool isDepthPeelingEnabled() const { return !alphaSort_ && bgDepthTexId_ != 0 && fgColorTexId_ != 0 && fgDepthTexId_ != 0; }
24 unsigned getBGDepthPeelingDepthTextureId() const { return bgDepthTexId_; }
25 unsigned getFGDepthPeelingColorTextureId() const { return fgColorTexId_; }
26 unsigned getFGDepthPeelingDepthTextureId() const { return fgDepthTexId_; }
27
28private:
29 bool alphaSort_{ false };
30 unsigned bgDepthTexId_ = 0;
31 unsigned fgColorTexId_ = 0;
32 unsigned fgDepthTexId_ = 0;
33};
34
37{
38 Opaque = 1 << 0,
39 Transparent = 1 << 1,
40 VolumeRendering = 1 << 2,
41 NoDepthTest = 1 << 3,
42
43 All =
45};
47
48}
#define MR_MAKE_FLAG_OPERATORS(T)
Definition MRFlagOperators.h:6
Definition MRCameraOrientationPlugin.h:8
RenderModelPassMask
Various passes of the 3D rendering.
Definition MRRenderModelParameters.h:37
struct to determine transparent rendering mode
Definition MRRenderModelParameters.h:10
unsigned getFGDepthPeelingDepthTextureId() const
Definition MRRenderModelParameters.h:26
unsigned getBGDepthPeelingDepthTextureId() const
Definition MRRenderModelParameters.h:24
bool isAlphaSortEnabled() const
Definition MRRenderModelParameters.h:22
TransparencyMode(unsigned bgDepthTexId, unsigned fgColorTexId, unsigned fgDepthTexId)
Definition MRRenderModelParameters.h:16
bool isDepthPeelingEnabled() const
Definition MRRenderModelParameters.h:23
unsigned getFGDepthPeelingColorTextureId() const
Definition MRRenderModelParameters.h:25
TransparencyMode(bool alphaSort)
Definition MRRenderModelParameters.h:13
TransparencyMode()=default