Blobalizer
Loading...
Searching...
No Matches
RayMarchingShader Class Reference

A class representing the shader responsible for the ray marching of the application. More...

#include <RayMarchingShader.h>

Inheritance diagram for RayMarchingShader:

Public Member Functions

 RayMarchingShader ()
 Loads the shader files from disk, then compiles and links them.
 
void bindSdf (GL::Texture3D &texture)
 Bind the given sdf texture to the shader.
 
void bindStructure (GL::Texture2D &texture)
 Bind the given structure texture to the shader.
 
void bindStructurePos (GL::Texture2D &texture)
 Bind the given structure positions texture to the shader.
 
void bindStructureMask (GL::Texture2D &texture)
 Bind the given structure mask texture to the shader.
 
void setViewportSize (const Vector2ui &viewportSize)
 Update the viewport size uniform of this shader.
 
void setProjectionMatrix (const Matrix4 &matrix)
 Update the projection matrix uniform of this shader.
 
void setViewMatrix (const Matrix4 &matrix)
 Update the view matrix uniform of this shader.
 
void setCameraPosition (const Vector3 &position)
 Update the camera position uniform of this shader.
 
void setSdfSize (const Vector3 &size)
 Set the size of the sdf grid in object space.
 
void setSurfaceRenderingMode (const UnsignedInt &mode)
 Set the surface rendering mode uniform. This decides how the surface is rendered.
 
void setDisplayMode (const UnsignedInt &mode)
 Set the display mode uniform. This decides whether to render the structure, the surface, or both combined.
 
void setDmax (const float dmax)
 Set the attenuation distance uniform. This is used for attenuating the inner structure based on distance from the surface.
 
void setSSS (const bool SSS)
 Set the subsurface scattering uniform. This is used to determine whether to render the subsurface scattering of the surface.
 
void setSSSMode (const UnsignedInt &mode)
 Set the subsurface scattering mode uniform. This is used to determine how to render the subsurface scattering of the surface.
 
void setReflectionCount (const UnsignedInt &reflectionCount)
 Set the reflection count uniform. This decides how many times the ray is reflected.
 
void setSurfaceColor (const Color3 &color)
 Set the surface color uniform. This decides in which color to render the surface.
 
void setSubSurfaceColor (const Color3 &color)
 Set the subsurface color uniform. This decides in which color to render the subsurface scattering effect.
 
void setSubSurfaceStrength (const float strength)
 Set the subsurface strength uniform. This is used for determining how strong the subsurface scattering effect is.
 

Private Types

enum  : Int { SDFTextureUnit = 0 , StructureTextureUnit = 1 , StructurePosTextureUnit = 2 , StructureMaskTextureUnit = 3 }
 

Private Attributes

Int viewportSizeUniform
 
Int viewMatrixUniform
 
Int projectionMatrixUniform
 
Int cameraPositionUniform
 
Int sdfSizeUniform
 
Int surfaceRenderingModeUniform
 
Int displayModeUniform
 
Int dmaxUniform
 
Int SSSUniform
 
Int SSSModeUniform
 
Int reflectionCountUniform
 
Int surfaceColorUniform
 
Int subSurfaceColorUniform
 
Int subSurfaceStrengthUniform
 

Detailed Description

A class representing the shader responsible for the ray marching of the application.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : Int
private
Enumerator
SDFTextureUnit 
StructureTextureUnit 
StructurePosTextureUnit 
StructureMaskTextureUnit 

Constructor & Destructor Documentation

◆ RayMarchingShader()

RayMarchingShader::RayMarchingShader ( )
inline

Loads the shader files from disk, then compiles and links them.

Member Function Documentation

◆ bindSdf()

void RayMarchingShader::bindSdf ( GL::Texture3D &  texture)
inline

Bind the given sdf texture to the shader.

Parameters
texturea 3d texture containing a signed-distance field grid of the object to render.

◆ bindStructure()

void RayMarchingShader::bindStructure ( GL::Texture2D &  texture)
inline

Bind the given structure texture to the shader.

Parameters
texturea 2d texture containing the rasterized render of the molecular structure.

◆ bindStructureMask()

void RayMarchingShader::bindStructureMask ( GL::Texture2D &  texture)
inline

Bind the given structure mask texture to the shader.

Parameters
texturea 2d texture containing the mask of the molecular structure.

◆ bindStructurePos()

void RayMarchingShader::bindStructurePos ( GL::Texture2D &  texture)
inline

Bind the given structure positions texture to the shader.

Parameters
texturea 2d texture containing the rasterized fragment positions texture of the molecular structure.

◆ setCameraPosition()

void RayMarchingShader::setCameraPosition ( const Vector3 &  position)
inline

Update the camera position uniform of this shader.

Parameters
matrixthe new vcamera position

◆ setDisplayMode()

void RayMarchingShader::setDisplayMode ( const UnsignedInt &  mode)
inline

Set the display mode uniform. This decides whether to render the structure, the surface, or both combined.

Parameters
modethe new display mode

◆ setDmax()

void RayMarchingShader::setDmax ( const float  dmax)
inline

Set the attenuation distance uniform. This is used for attenuating the inner structure based on distance from the surface.

Parameters
dmaxthe new attenuation distance

◆ setProjectionMatrix()

void RayMarchingShader::setProjectionMatrix ( const Matrix4 &  matrix)
inline

Update the projection matrix uniform of this shader.

Parameters
matrixthe new projection matrix

◆ setReflectionCount()

void RayMarchingShader::setReflectionCount ( const UnsignedInt &  reflectionCount)
inline

Set the reflection count uniform. This decides how many times the ray is reflected.

Parameters
reflectionCountthe new reflection count

◆ setSdfSize()

void RayMarchingShader::setSdfSize ( const Vector3 &  size)
inline

Set the size of the sdf grid in object space.

Parameters
sizethe size of the sdf grid in object space.

◆ setSSS()

void RayMarchingShader::setSSS ( const bool  SSS)
inline

Set the subsurface scattering uniform. This is used to determine whether to render the subsurface scattering of the surface.

Parameters
SSSthe new subsurface scattering value

◆ setSSSMode()

void RayMarchingShader::setSSSMode ( const UnsignedInt &  mode)
inline

Set the subsurface scattering mode uniform. This is used to determine how to render the subsurface scattering of the surface.

Parameters
modethe new subsurface scattering mode

◆ setSubSurfaceColor()

void RayMarchingShader::setSubSurfaceColor ( const Color3 &  color)
inline

Set the subsurface color uniform. This decides in which color to render the subsurface scattering effect.

Parameters
colorthe new subsurface color

◆ setSubSurfaceStrength()

void RayMarchingShader::setSubSurfaceStrength ( const float  strength)
inline

Set the subsurface strength uniform. This is used for determining how strong the subsurface scattering effect is.

Parameters
strengththe new subsurface strength

◆ setSurfaceColor()

void RayMarchingShader::setSurfaceColor ( const Color3 &  color)
inline

Set the surface color uniform. This decides in which color to render the surface.

Parameters
colorthe new surface color

◆ setSurfaceRenderingMode()

void RayMarchingShader::setSurfaceRenderingMode ( const UnsignedInt &  mode)
inline

Set the surface rendering mode uniform. This decides how the surface is rendered.

Parameters
modethe new surface rendering mode

◆ setViewMatrix()

void RayMarchingShader::setViewMatrix ( const Matrix4 &  matrix)
inline

Update the view matrix uniform of this shader.

Parameters
matrixthe new view matrix

◆ setViewportSize()

void RayMarchingShader::setViewportSize ( const Vector2ui &  viewportSize)
inline

Update the viewport size uniform of this shader.

Parameters
viewportSizethe new viewport size

Member Data Documentation

◆ cameraPositionUniform

Int RayMarchingShader::cameraPositionUniform
private

◆ displayModeUniform

Int RayMarchingShader::displayModeUniform
private

◆ dmaxUniform

Int RayMarchingShader::dmaxUniform
private

◆ projectionMatrixUniform

Int RayMarchingShader::projectionMatrixUniform
private

◆ reflectionCountUniform

Int RayMarchingShader::reflectionCountUniform
private

◆ sdfSizeUniform

Int RayMarchingShader::sdfSizeUniform
private

◆ SSSModeUniform

Int RayMarchingShader::SSSModeUniform
private

◆ SSSUniform

Int RayMarchingShader::SSSUniform
private

◆ subSurfaceColorUniform

Int RayMarchingShader::subSurfaceColorUniform
private

◆ subSurfaceStrengthUniform

Int RayMarchingShader::subSurfaceStrengthUniform
private

◆ surfaceColorUniform

Int RayMarchingShader::surfaceColorUniform
private

◆ surfaceRenderingModeUniform

Int RayMarchingShader::surfaceRenderingModeUniform
private

◆ viewMatrixUniform

Int RayMarchingShader::viewMatrixUniform
private

◆ viewportSizeUniform

Int RayMarchingShader::viewportSizeUniform
private

The documentation for this class was generated from the following file: