19class RENDER_API VolumeOSPRay :
public VolumeAlgorithm {
21 enum WindingOrder { CCW, CW, INVALID };
23 VolumeOSPRay(GLManager *gl, VolumeRenderer *renderer);
26 static std::string GetName();
27 static Type GetType() {
return Type::DVR; }
28 virtual bool RequiresChunkedRendering() {
return false; }
30 virtual void SaveDepthBuffer(
bool fast);
31 virtual int Render(
bool fast);
32 virtual int LoadData(
const Grid *grid);
33 virtual int LoadSecondaryData(
const Grid *grid) {
return 0; }
34 virtual void DeleteSecondaryData() {}
35 virtual ShaderProgram *GetShader()
const;
36 virtual void SetUniforms(
const ShaderProgram *shader)
const;
37 virtual float GuestimateFastModeSpeedupFactor()
const;
38 virtual void GetFinalBlendingMode(
int *src,
int *dst);
41 virtual bool _isIso()
const {
return false; }
44 std::vector<size_t> _dataDimensions;
45 std::vector<float> _depthData;
46 std::vector<unsigned char> _backplateData;
47 Texture2D _ospRenderTexture;
48 Texture2D _ospWriteDepthTexture;
51 } _clipBox = {glm::vec3(0), glm::vec3(1)};
52 float _ospSampleRateScalar;
58 OSPRenderer _ospRenderer =
nullptr;
59 OSPWorld _ospWorld =
nullptr;
60 OSPCamera _ospCamera =
nullptr;
61 OSPTransferFunction _ospTF =
nullptr;
62 OSPInstance _ospInstance =
nullptr;
63 OSPVolumetricModel _ospVolumeModel =
nullptr;
64 OSPLight _ospLightAmbient =
nullptr;
65 OSPLight _ospLightDistant =
nullptr;
66 OSPGeometry _ospIso =
nullptr;
67 OSPGeometricModel _ospIsoModel =
nullptr;
69 void _setupRenderer(
bool fast);
73 void _applyTransform();
75 void _copyBackplate();
77 float _guessSamplingRateScalar(
const Grid *grid)
const;
78 OSPVolume _loadVolumeRegular(
const Grid *grid);
79 OSPVolume _loadVolumeStructured(
const Grid *grid);
80 OSPVolume _loadVolumeUnstructured(
const Grid *grid);
81 OSPVolume _loadVolumeTest(
const Grid *grid);
83 static WindingOrder getWindingOrderRespectToZ(
const glm::vec3 &a,
const glm::vec3 &b,
const glm::vec3 &c);
84 static WindingOrder getWindingOrderTetra(
const glm::vec3 &a,
const glm::vec3 &b,
const glm::vec3 &c,
const glm::vec3 &d);
85 static const char * windingOrderToString(WindingOrder o);
86 static bool isQuadCoPlanar(
const glm::vec3 &a,
const glm::vec3 &b,
const glm::vec3 &c,
const glm::vec3 &d);
93 static std::string
GetName() {
return "OSPRay"; }
107 static std::string
GetName() {
return "Iso OSPRay (experimental)"; }
Strategy pattern for volume rendering algorithms.
OSPRay isosurface rendering adapter.
static std::string GetName()
VolumeOSPRayIso(GLManager *gl, VolumeRenderer *renderer)
OSPRay volume rendering adapter.
static std::string GetName()
VolumeOSPRay(GLManager *gl, VolumeRenderer *renderer)
Contains references to context scope OpenGL data.