51 #ifndef vtkDualDepthPeelingPass_h 52 #define vtkDualDepthPeelingPass_h 54 #include "vtkRenderingOpenGL2Module.h" 84 virtual void SetVolumetricPass(
vtkRenderPass *volumetricPass);
106 bool PostReplaceTranslucentShaderValues(
std::string &vertexShader,
111 bool PreReplaceVolumetricShaderValues(
std::string &vertexShader,
159 void SetCurrentStage(ShaderStage stage);
160 vtkSetMacro(CurrentPeelType, PeelType)
165 void FreeGLObjects();
170 void RenderTranslucentPass();
175 void RenderVolumetricPass();
177 bool IsRenderingVolumes();
199 { this->ActivateDrawBuffers(&
id, 1); }
200 template <
size_t NumTextures>
202 { this->ActivateDrawBuffers(a.data(), a.size()); }
203 void ActivateDrawBuffers(
const TextureName *ids,
size_t numTextures);
211 void InitializeOcclusionQuery();
212 void CopyOpaqueDepthBuffer();
213 void InitializeDepth();
215 void PeelVolumesOutsideTranslucentRange();
227 void PrepareFrontDestination();
228 void ClearFrontDestination();
229 void CopyFrontSourceToFrontDestination();
231 void InitializeTargetsForTranslucentPass();
232 void InitializeTargetsForVolumetricPass();
234 void PeelTranslucentGeometry();
235 void PeelVolumetricGeometry();
237 void BlendBackBuffer();
239 void StartTranslucentOcclusionQuery();
240 void EndTranslucentOcclusionQuery();
242 void StartVolumetricOcclusionQuery();
243 void EndVolumetricOcclusionQuery();
248 void SwapFrontBufferSourceDest();
249 void SwapDepthBufferSourceDest();
253 void AlphaBlendRender();
255 void BlendFinalImage();
256 void DeleteOcclusionQueryIds();
311 #endif // vtkDualDepthPeelingPass_h abstract superclass for all actors, volumes and annotations
void ActivateDrawBuffers(const std::array< TextureName, NumTextures > &a)
Bind and activate draw buffers.
Implement Depth Peeling for use within a framebuffer pass.
const vtkRenderState * RenderState
bool SaveScissorTestState
unsigned int TranslucentOcclusionQueryId
vtkTypeUInt32 vtkMTimeType
record modification and/or execution time
unsigned int VolumetricWrittenPixels
vtkShaderProgram * CopyDepthProgram
vtkTimeStamp CurrentStageTimeStamp
TextureName DepthDestination
vtkOpenGLBufferObject * BackBlendVBO
vtkOpenGLBufferObject * BlendVBO
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
window superclass for vtkRenderWindow
vtkOpenGLVertexArrayObject * CopyColorVAO
unsigned int OcclusionThreshold
Context in which a vtkRenderPass will render.
vtkShaderProgram * BlendProgram
vtkOpenGLVertexArrayObject * CopyDepthVAO
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
vtkOpenGLBufferObject * CopyColorVBO
int VolumetricRenderCount
Internal class which encapsulates OpenGL FramebufferObject.
int TranslucentRenderCount
static vtkDepthPeelingPass * New()
vtkShaderProgram * BackBlendProgram
abstract class specifies interface to map data
virtual bool PreReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop)
Use vtkShaderProgram::Substitute to replace //VTK::XXX:YYY declarations in the shader sources...
abstracts an OpenGL texture object.
void ReleaseGraphicsResources(vtkWindow *w) override
Release graphics resources and ask components to release their own resources.
vtkRenderPass * VolumetricPass
virtual vtkMTimeType GetShaderStageMTime()
For multi-stage render passes that need to change shader code during a single pass, use this method to notify a mapper that the shader needs to be rebuilt (rather than reuse the last cached shader.
Implements the dual depth peeling algorithm.
void Render(const vtkRenderState *s) override
Perform rendering according to a render state s.
void ActivateDrawBuffer(TextureName id)
Bind and activate draw buffers.
bool PostReplaceShaderValues(std::string &vertexShader, std::string &geometryShader, std::string &fragmentShader, vtkAbstractMapper *mapper, vtkProp *prop) override
Use vtkShaderProgram::Substitute to replace //VTK::XXX:YYY declarations in the shader sources...
bool SetShaderParameters(vtkShaderProgram *program, vtkAbstractMapper *mapper, vtkProp *prop, vtkOpenGLVertexArrayObject *VAO=nullptr) override
Update the uniforms of the shader program.
vtkRenderTimerLog * Timer
Perform part of the rendering of a vtkRenderer.
unsigned int TranslucentWrittenPixels
unsigned int VolumetricOcclusionQueryId
vtkOpenGLVertexArrayObject * BackBlendVAO
vtkShaderProgram * CopyColorProgram
vtkOpenGLBufferObject * CopyDepthVBO
vtkOpenGLVertexArrayObject * BlendVAO
TextureName FrontDestination
Asynchronously measures GPU execution times for a series of events.
The ShaderProgram uses one or more Shader objects.