1 #ifndef VOLUMERENDERER_PRIVATE_H
2 #define VOLUMERENDERER_PRIVATE_H
16 extern PFNGLBINDIMAGETEXTUREPROC __glBindImageTexture;
17 extern PFNGLDISPATCHCOMPUTEPROC __glDispatchCompute;
19 #define glBindImageTexture __glBindImageTexture
20 #define glDispatchCompute __glDispatchCompute
23 #define ATTRPOS_VERTEX 0
24 #define ATTRPOS_COLOR 1
27 #define TEXUNIT_VOLUME 0
28 #define TEXUNIT_TRANSFUNC 1
30 #define TEXUNIT_INTENSITY 2
31 #define TEXUNIT_SMOOTH 3
34 #define TEXUNIT_SLICE 4
36 #define TEXUNIT_PREVIOUS 5
38 #define TEXUNIT_INTERMEDIATE 6
41 #define IMGUNIT_VOLUME 0
42 #define IMGUNIT_SMOOTH 1
45 #define SLICEBUFFER_STRIDE 8
47 #define SLICEBUFFER_SLICECOUNT 2048
50 #define SYNC_TIMEOUT 1000000
58 QOpenGLDebugLogger* glLogger;
61 bool volumeLoaded,fixSlicingMatrix,renderBB,smoothVolume,showLightDir;
63 QByteArray currentVolumeData;
67 QVector3D lightVec,halfVec;
69 VolumeRenderer::ProjectionType projType;
70 QMatrix4x4 mProj, view, mvp, mSlicing;
72 int sliceCount,renderedSlices;
75 float focalPlaneDist,blurAmount;
77 int winWidth,winHeight;
83 int currentSliceOffset;
84 GLsync sliceSync[SLICEBUFFER_SLICECOUNT];
86 QList<QString> glExtensions;
89 float rotX,rotY,distance,sliceDelta;
90 float lightAz,lightAngle;
97 QOpenGLShaderProgram* blur;
98 QOpenGLShaderProgram* merge;
99 QOpenGLShaderProgram* transform;
100 QOpenGLShaderProgram* color;
101 QOpenGLShaderProgram* bBox;
102 QOpenGLShaderProgram* slice;
103 QOpenGLShaderProgram* gaussian;
104 QOpenGLShaderProgram* gradient;
109 QOpenGLBuffer* vBuffer;
110 QOpenGLBuffer* lineBuffer;
111 QOpenGLBuffer* sliceVBuffer;
112 QOpenGLBuffer* iBuffer;
113 size_t triangleIndexOffset, lineIndexOffset, sliceIndexOffset;
117 QOpenGLVertexArrayObject* box;
118 QOpenGLVertexArrayObject* line;
119 QOpenGLVertexArrayObject* slice;
124 QOpenGLFramebufferObject* slice;
125 QOpenGLFramebufferObject* eye[2];
126 QOpenGLFramebufferObject* intermediate[2];
133 QOpenGLTexture* volume;
137 : distance(2.0f),rotX(0),rotY(0),projType(VolumeRenderer::ProjectionType::Perspective),
138 renderBB(
true),sliceDelta(0.01f),window(0.0f,1.0f),frametime(0),volumeLoaded(
false),fixSlicingMatrix(
false),showLightDir(
false),smoothVolume(
true),lightAz(180.0f),lightAngle(15.0f),gaussSigma(0.6f),
139 currentSliceOffset(0), focalPlaneDist(0.5f), blurAmount(0.5f), doDOF(
true), sliceCount(0), renderedSlices(0)
141 fbos.slice =
nullptr;
142 fbos.eye[0] = fbos.eye[1] =
nullptr;
143 fbos.intermediate[0] = fbos.intermediate[1] =
nullptr;
144 fbos.eDraw = fbos.iDraw = 0;
145 fbos.eRead = fbos.iRead = 1;
147 for(
int i =0;i<SLICEBUFFER_SLICECOUNT;++i)
149 sliceSync[i] =
nullptr;
Class for loading volume meta data (VolumeMetaData) as well as the raw volume data itself...
Definition: volumeloader.h:86
This includes the public VolumeRenderer class.
Contains private data of the volume renderer.
Definition: volumerenderer_private.h:55
Describes a equilateral cube, centered on the origin.
Definition: geometry.h:15
This file includes the VolumeLoader class, as well as the VolumeMetaData structure.
Contains general-purpose geometric helpers, like the Cube structure and Line-Plane intersection algor...