MeVisLab Resolution Independence API
Loading...
Searching...
No Matches
SoFramebufferSampler.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_FRAMEBUFFER_SAMPLER_H
14#define SO_FRAMEBUFFER_SAMPLER_H
15
16
18
19#include "SoShaderSystem.h"
21#include <Inventor/fields/SoSFNode.h>
22#include <Inventor/fields/SoSFColor.h>
23#include <Inventor/fields/SoSFFloat.h>
24#include <Inventor/fields/SoSFEnum.h>
25#include <Inventor/fields/SoSFBool.h>
26#include <Inventor/fields/SoSFTrigger.h>
27
28class SoGLFramebufferObject;
29class SoGLTexture;
30class SoGLRenderbuffer;
32class SoFramebufferSamplerOffscreenSceneRenderer;
33
36{
37 typedef SoSampler inherited;
38
39 SO_NODE_HEADER(SoFramebufferSampler);
40
41public:
44 RGB = GL_RGB,
45 RGB8 = GL_RGB8,
46 RGB16 = GL_RGB16,
47 RGB16F = GL_RGB16F_ARB,
48 RGB32F = GL_RGB32F_ARB,
49 RGBA = GL_RGBA,
50 RGBA8 = GL_RGBA8,
51 RGBA16 = GL_RGBA16,
52 RGBA16F = GL_RGBA16F_ARB,
53 RGBA32F = GL_RGBA32F_ARB
54 };
55
62
65
68
70 SoSFBool stencilBuffer;
71
73 SoSFColor clearColor;
74
76 SoSFFloat clearAlpha;
77
79 SoSFEnum wrapT;
80
83
86
88 SoSFFloat sizeMultiplier;
89
92 SoSFFloat pixelScale;
93
96
98 SoSFTrigger takeSnapshot;
99
103
106
107protected:
113
114 SbBool _rebuild;
116 int32_t _dataFormat;
117
120
121 SoGLFramebufferObject* _framebufferObject;
122 SoGLTexture* _colorBuffer;
123 SoGLRenderbuffer* _depthBufferRBU;
124 SoGLTexture* _depthBufferTEX;
125 SoGLRenderbuffer* _stencilBuffer;
126
128
129 SoFramebufferSamplerOffscreenSceneRenderer* _offscreenSceneRenderer;
130
133
135 virtual void applyRenderAction(SoState*);
136
138 void nameChanged(SoField* field) override;
139
140SoEXTENDER public :
141
143 void GLRender(SoGLRenderAction* action) override;
144
146 void getBoundingBox(SoGetBoundingBoxAction* action) override;
147
148 void handleEvent(SoHandleEventAction* action) override;
149
153
155 void updatePreparationInternal(SoGLRenderAction* action);
156
159
160SoINTERNAL public :
161
163 static void initClass();
164
165private:
166 void snapshotChangedCB(SoField* field);
167};
168
169#endif // _SO_FRAMEBUFFER_SAMPLER_
#define INVENTOR_SHADER_API
Define class export specifier.
SoSFEnum colorBufferFormat
Internal format of color buffer. Default is RGBA.
SoGLFramebufferObject * _framebufferObject
void updatePreparationInternal(SoGLRenderAction *action)
Helper method to call updatePreparation.
static void initClass()
Initialize class with runtime type system.
~SoFramebufferSampler() override
Destructor.
SoSFEnum depthBufferTarget
Enable/Disable depth buffer. Default is TRUE.
SoSFEnum wrapT
Wrapping mode.
SoSFTrigger takeSnapshot
Take a snapshot of the scene.
SoSFBool useFormatStateHints
Read state for format hints.
SoSFFloat sizeMultiplier
Size provided by size state hints is multiplied with this value.
virtual void applyRenderAction(SoState *)
Function applies render action to children.
void renderInSeparateRenderAction()
SoSFBool stencilBuffer
Enable/Disable stencil buffer. Default is FALSE.
SoGLRenderbuffer * _stencilBuffer
void handleEvent(SoHandleEventAction *action) override
SoSFBool useSizeStateHints
Read state for size hints.
void getBoundingBox(SoGetBoundingBoxAction *action) override
Compute bounding-box of subgraph.
SoResolutionIndependentViewerProxy * _proxy
void GLRender(SoGLRenderAction *action) override
Add node to parameter list element, and call 'updatePreparation'.
SoSFColor clearColor
Color used to clear the color buffer.
static void resetFixedFunctionGLState()
Resets the current GL state as far as possible (but leaves FBO intact, to allow push/pop later).
ColorBufferFormat
Internal texture format for color buffer.
SoGLRenderbuffer * _depthBufferRBU
SoFramebufferSamplerOffscreenSceneRenderer * _offscreenSceneRenderer
SoSFFloat clearAlpha
Alpha value used to clear the color buffer.
ColorBufferFormat _fldValColorBufferFormat
void nameChanged(SoField *field) override
Called when sampler name has changed.
SoSFBool automaticTraversal
Automatically traverse child scene.
DepthBufferTarget
Depth buffer mode.
DepthBufferTarget _fldValDepthBufferTarget
SoFramebufferSampler()
Constructor.
SbString _depthTextureName
name of the uniform ?_depth parameter
SoSampler()
Constructor.