Castor3D 0.12.0
Multiplatform 3D engine
|
#include <GlslReflection.hpp>
Fonctions membres publiques | |
C3D_API | ReflectionModel (sdw::ShaderWriter &writer, Utils &utils, PassFlags const &passFlags) |
C3D_API | ReflectionModel (sdw::ShaderWriter &writer, Utils &utils) |
virtual C3D_API | ~ReflectionModel ()=default |
virtual C3D_API void | computeDeferred (LightMaterial &material, Surface const &surface, SceneData const &sceneData, sdw::Int envMapIndex, sdw::Int const &reflection, sdw::Int const &refraction, sdw::Float const &refractionRatio, sdw::Vec3 const &transmission, sdw::Vec3 &ambient, sdw::Vec3 &reflected, sdw::Vec3 &refracted)=0 |
virtual C3D_API sdw::Vec3 | computeForward (LightMaterial &material, Surface const &surface, SceneData const &sceneData)=0 |
virtual C3D_API sdw::Vec3 | computeForward (LightMaterial &material, Surface const &surface, SceneData const &sceneData, sdw::Float const &refractionRatio, sdw::Vec3 const &transmission)=0 |
virtual C3D_API void | computeForward (LightMaterial &material, Surface const &surface, SceneData const &sceneData, sdw::Float const &refractionRatio, sdw::Vec3 const &transmission, sdw::Vec3 &ambient, sdw::Vec3 &reflected, sdw::Vec3 &refracted)=0 |
C3D_API sdw::Float | computeFresnel (LightMaterial &material, Surface const &surface, SceneData const &sceneData, sdw::Float const &refractionRatio) |
C3D_API sdw::Vec4 | computeScreenSpace (MatrixData const &matrixData, sdw::Vec3 const &viewPosition, sdw::Vec3 const &worldNormal, sdw::Vec2 const &texcoord, sdw::Vec4 const &ssrSettings, sdw::CombinedImage2DR32 const &depthMap, sdw::CombinedImage2DRgba32 const &normalMap, sdw::CombinedImage2DRgba32 const &colourMap) |
sdw::Boolean | traceScreenSpace (sdw::Vec3 csOrigin, sdw::Vec3 csDirection, sdw::Mat4 projectToPixelMatrix, sdw::CombinedImage2DR32 csZBuffer, sdw::Vec2 csZBufferSize, sdw::Float csZThickness, sdw::Boolean csZBufferIsHyperbolic, sdw::Vec3 clipInfo, sdw::Float nearPlaneZ, sdw::Float stride, sdw::Float jitterFraction, sdw::Float maxSteps, sdw::Float maxRayTraceDistance, sdw::Vec2 &hitPixel, sdw::Vec3 &csHitPoint) |
Fonctions membres protégées | |
void | declareTraceScreenSpace () |
void | declareComputeScreenSpace (MatrixData const &matrixData) |
void | declareComputeFresnel () |
Attributs protégés | |
sdw::ShaderWriter & | m_writer |
Utils & | m_utils |
PassFlags | m_passFlags |
sdw::Function< sdw::Boolean, sdw::InVec3, sdw::InVec3, sdw::InMat4, sdw::InCombinedImage2DR32, sdw::InVec2, sdw::InFloat, sdw::InBoolean, sdw::InVec3, sdw::InFloat, sdw::InFloat, sdw::InFloat, sdw::InFloat, sdw::InFloat, sdw::OutVec2, sdw::OutVec3 > | m_traceScreenSpace |
sdw::Function< sdw::Vec4, sdw::InVec3, sdw::InVec3, sdw::InVec2, sdw::InVec4, sdw::InCombinedImage2DR32, sdw::InCombinedImage2DRgba32, sdw::InCombinedImage2DRgba32 > | m_computeScreenSpace |
sdw::Function< sdw::Float, InSurface, sdw::InFloat, sdw::InVec3, sdw::InFloat > | m_computeFresnel |
C3D_API castor3d::shader::ReflectionModel::ReflectionModel | ( | sdw::ShaderWriter & | writer, |
Utils & | utils, | ||
PassFlags const & | passFlags | ||
) |
C3D_API castor3d::shader::ReflectionModel::ReflectionModel | ( | sdw::ShaderWriter & | writer, |
Utils & | utils | ||
) |
|
virtualdefault |
|
pure virtual |
Implémenté dans castor3d::shader::PbrReflectionModel, et castor3d::shader::PhongReflectionModel.
|
pure virtual |
Implémenté dans castor3d::shader::PbrReflectionModel, et castor3d::shader::PhongReflectionModel.
|
pure virtual |
Implémenté dans castor3d::shader::PbrReflectionModel, et castor3d::shader::PhongReflectionModel.
|
pure virtual |
Implémenté dans castor3d::shader::PbrReflectionModel, et castor3d::shader::PhongReflectionModel.
C3D_API sdw::Float castor3d::shader::ReflectionModel::computeFresnel | ( | LightMaterial & | material, |
Surface const & | surface, | ||
SceneData const & | sceneData, | ||
sdw::Float const & | refractionRatio | ||
) |
C3D_API sdw::Vec4 castor3d::shader::ReflectionModel::computeScreenSpace | ( | MatrixData const & | matrixData, |
sdw::Vec3 const & | viewPosition, | ||
sdw::Vec3 const & | worldNormal, | ||
sdw::Vec2 const & | texcoord, | ||
sdw::Vec4 const & | ssrSettings, | ||
sdw::CombinedImage2DR32 const & | depthMap, | ||
sdw::CombinedImage2DRgba32 const & | normalMap, | ||
sdw::CombinedImage2DRgba32 const & | colourMap | ||
) |
|
protected |
|
protected |
|
protected |
sdw::Boolean castor3d::shader::ReflectionModel::traceScreenSpace | ( | sdw::Vec3 | csOrigin, |
sdw::Vec3 | csDirection, | ||
sdw::Mat4 | projectToPixelMatrix, | ||
sdw::CombinedImage2DR32 | csZBuffer, | ||
sdw::Vec2 | csZBufferSize, | ||
sdw::Float | csZThickness, | ||
sdw::Boolean | csZBufferIsHyperbolic, | ||
sdw::Vec3 | clipInfo, | ||
sdw::Float | nearPlaneZ, | ||
sdw::Float | stride, | ||
sdw::Float | jitterFraction, | ||
sdw::Float | maxSteps, | ||
sdw::Float | maxRayTraceDistance, | ||
sdw::Vec2 & | hitPixel, | ||
sdw::Vec3 & | csHitPoint | ||
) |
csOrigin | Camera-space ray origin, which must be within the view volume and must have z < -0.01 and project within the valid screen rectangle. |
csDirection | Unit length camera-space ray direction. |
projectToPixelMatrix | A projection matrix that maps to pixel coordinates (not [-1, +1] normalized device coordinates). |
csZBuffer | The depth or camera-space Z buffer, depending on the value of csZBufferIsHyperbolic. |
csZBufferSize | Dimensions of csZBuffer. |
csZThickness | Camera space thickness to ascribe to each pixel in the depth buffer. |
csZBufferIsHyperbolic | True if csZBuffer is an OpenGL depth buffer, false (faster) if csZBuffer contains (negative) "linear" camera space z values. Const so that the compiler can evaluate the branch based on it at compile time. |
clipInfo | See G3D::Camera documentation. |
nearPlaneZ | Negative number. |
stride | Step in horizontal or vertical pixels between samples. This is a float because integer math is slow on GPUs, but should be set to an integer >= 1. |
jitterFraction | Number between 0 and 1 for how far to bump the ray in stride units to conceal banding artifacts. |
maxSteps | Maximum number of iterations. Higher gives better images but may be slow. |
maxRayTraceDistance | Maximum camera-space distance to trace before returning a miss. |
hitPixel | Pixel coordinates of the first intersection with the scene. |
csHitPoint | Camera space location of the ray hit. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |