Castor3D 0.16.0
Multiplatform 3D engine
|
#include <GlslUtils.hpp>
Public Member Functions | |
C3D_API | Utils (sdw::ShaderWriter &writer) |
C3D_API sdw::Float | saturate (sdw::Float const v) |
C3D_API sdw::Vec3 | saturate (sdw::Vec3 const v) |
C3D_API sdw::Vec2 | topDownToBottomUp (sdw::Vec2 const texCoord) |
C3D_API sdw::Vec3 | topDownToBottomUp (sdw::Vec3 const texCoord) |
C3D_API sdw::Vec4 | topDownToBottomUp (sdw::Vec4 const texCoord) |
C3D_API sdw::Vec2 | negateTopDownToBottomUp (sdw::Vec2 const texCoord) |
C3D_API sdw::Vec3 | negateTopDownToBottomUp (sdw::Vec3 const texCoord) |
C3D_API sdw::Vec4 | negateTopDownToBottomUp (sdw::Vec4 const texCoord) |
C3D_API sdw::Vec2 | calcTexCoord (sdw::Vec2 const renderPos, sdw::Vec2 const renderSize) |
C3D_API sdw::Vec3 | applyGamma (sdw::Float const gamma, sdw::Vec3 const HDR) |
C3D_API sdw::Vec3 | removeGamma (sdw::Float const gamma, sdw::Vec3 const sRGB) |
C3D_API sdw::Float | remap (sdw::Float const originalValue, sdw::Float const originalMin, sdw::Float const originalMax, sdw::Float const newMin, sdw::Float const newMax) |
C3D_API sdw::Float | threshold (sdw::Float const v, sdw::Float const t) |
C3D_API sdw::Float | beer (sdw::Float const d) |
C3D_API sdw::Float | powder (sdw::Float const d) |
C3D_API sdw::Float | powder (sdw::Float const d, sdw::Float const cosTheta) |
C3D_API sdw::Vec4 | sampleMap (sdw::CombinedImage2DRgba32 const map, sdw::Vec2 const texCoords) |
C3D_API sdw::Vec4 | sampleMap (sdw::CombinedImage2DRgba32 const map, sdw::Vec3 const texCoords) |
C3D_API sdw::Vec4 | sampleMap (sdw::CombinedImage2DRgba32 const map, sdw::Vec2 const texCoords, sdw::Float const lod) |
C3D_API sdw::Vec4 | sampleMap (sdw::CombinedImage2DRgba32 const map, sdw::Vec3 const texCoords, sdw::Float const lod) |
C3D_API sdw::Vec4 | sampleMap (sdw::CombinedImage2DRgba32 const map, DerivTex const texCoords) |
C3D_API sdw::RetVec2 | transformUV (TextureConfigData const &config, TextureTransformData const &anim, sdw::Vec2 const uv) |
C3D_API sdw::RetVec3 | transformUVW (TextureConfigData const &config, TextureTransformData const &anim, sdw::Vec3 const uv) |
C3D_API void | swap (sdw::Float const A, sdw::Float const &B) |
C3D_API sdw::RetFloat | distanceSquared (sdw::Vec2 const A, sdw::Vec2 const &B) |
C3D_API sdw::RetFloat | distanceSquared (sdw::Vec3 const A, sdw::Vec3 const &B) |
C3D_API sdw::RetVec3 | calcVSPosition (sdw::Vec2 const &uv, sdw::Float const &depth, sdw::Mat4 const &invProj) |
C3D_API sdw::RetVec3 | calcWSPosition (sdw::Vec2 const &uv, sdw::Float const &depth, sdw::Mat4 const &invViewProj) |
C3D_API sdw::RetVec3 | getMapNormal (sdw::Vec2 const &uv, sdw::Vec3 const &normal, sdw::Vec3 const &position) |
C3D_API sdw::RetFloat | rescaleDepth (sdw::Float const &depth, sdw::Float const &nearPlane, sdw::Float const &farPlane) |
C3D_API sdw::Float | lineariseDepth (sdw::Float const &depth, sdw::Float const &nearPlane, sdw::Float const &farPlane) const |
C3D_API sdw::RetVec4 | computeAccumulation (sdw::Float const &depth, sdw::Vec3 const &colour, sdw::Float const &alpha, sdw::Float const &nearPlane, sdw::Float const &farPlane, sdw::UInt const &accumulationOperator) |
C3D_API sdw::RetFloat | conductorFresnel (sdw::Float const &product, sdw::Float const &f0, sdw::Float const &f90) |
C3D_API sdw::RetFloat | conductorFresnel (sdw::Float const &product, sdw::Float const &f0) |
C3D_API sdw::RetVec3 | conductorFresnel (sdw::Float const &product, sdw::Vec3 const &f0, sdw::Vec3 const &f90) |
C3D_API sdw::RetVec3 | conductorFresnel (sdw::Float const &product, sdw::Vec3 const &f0) |
C3D_API RetDerivVec3 | conductorFresnel (DerivFloat const &product, sdw::Vec3 const &f0, sdw::Vec3 const &f90) |
C3D_API RetDerivVec3 | conductorFresnel (DerivFloat const &product, sdw::Vec3 const &f0) |
C3D_API sdw::RetFloat | fresnelMix (sdw::Float const &VdotH, sdw::Float const &refractionRatio) |
C3D_API sdw::RetFloat | fresnelMix (sdw::Vec3 const &incident, sdw::Vec3 const &normal, sdw::Float const &refractionRatio) |
C3D_API sdw::RetVec4 | clipToScreen (sdw::Vec4 const &in) |
C3D_API sdw::RetFloat | reconstructCSZ (sdw::Float const &depth, sdw::Vec3 const clipInfo) |
C3D_API sdw::RetBoolean | isSaturated (sdw::Vec3 const &p) |
C3D_API sdw::RetBoolean | isSaturated (sdw::IVec3 const &p, sdw::Int const &imax) |
C3D_API sdw::RetUInt | encodeColor (sdw::Vec4 const &color) |
Encode HDR color to a 32 bit uint. Alpha is 1 bit + 7 bit HDR remapping. | |
C3D_API sdw::RetUInt | encodeNormal (sdw::Vec3 const &normal) |
Encode specified normal (normalized) into 32 bits uint. Each axis of the normal is encoded into 9 bits (1 for the sign/ 8 for the value). | |
C3D_API sdw::RetVec4 | decodeColor (sdw::UInt const &colorMask) |
C3D_API sdw::RetVec3 | decodeNormal (sdw::UInt const &normalMask) |
C3D_API sdw::RetVec4 | encodeFloatRGBA (sdw::Float const &v) |
Converts a 32 bit float to store as 4 8 bit floats. | |
C3D_API sdw::RetUInt | flatten (sdw::UVec3 const &p, sdw::UVec3 const &dim) |
3D array index to flattened 1D array index | |
C3D_API sdw::RetUVec3 | unflatten (sdw::UInt const &p, sdw::UVec3 const &dim) |
Flattened array index to 3D array index. | |
sdw::RetFloat | iorToFresnel0 (sdw::Float const &transmittedIor, sdw::Float const &incidentIor) |
sdw::RetVec3 | iorToFresnel0 (sdw::Vec3 const &transmittedIor, sdw::Float const &incidentIor) |
sdw::RetVec3 | fresnel0ToIor (sdw::Vec3 const &fresnel0) |
C3D_API sdw::RetVec3 | fresnelToF0 (sdw::Vec3 const &fresnel, sdw::Float const &VdotH) |
C3D_API sdw::RetVec3 | evalIridescence (sdw::Float const &outsideIOR, sdw::Float const &eta2, sdw::Float const &cosTheta1, sdw::Float const &thinFilmThickness, sdw::Vec3 const &baseF0) |
C3D_API sdw::RetVec3 | evalSensitivity (sdw::Float const &OPD, sdw::Vec3 const &shift) |
Static Public Member Functions | |
static C3D_API sdw::Mat3 | getTBN (sdw::Vec3 const &normal, sdw::Vec3 const &tangent, sdw::Vec3 const &bitangent) |
static C3D_API sdw::Float | computeF0 (sdw::Float const &ior) |
static C3D_API sdw::Vec3 | reconstructNormal (sdw::Vec2 const &normal) |
static C3D_API sdw::Vec3 | reconstructNormal (sdw::Float const &normalX, sdw::Float const &normalY) |
|
explicit |
C3D_API sdw::Vec3 castor3d::shader::Utils::applyGamma | ( | sdw::Float const | gamma, |
sdw::Vec3 const | HDR ) |
C3D_API sdw::Float castor3d::shader::Utils::beer | ( | sdw::Float const | d | ) |
C3D_API sdw::Vec2 castor3d::shader::Utils::calcTexCoord | ( | sdw::Vec2 const | renderPos, |
sdw::Vec2 const | renderSize ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::calcVSPosition | ( | sdw::Vec2 const & | uv, |
sdw::Float const & | depth, | ||
sdw::Mat4 const & | invProj ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::calcWSPosition | ( | sdw::Vec2 const & | uv, |
sdw::Float const & | depth, | ||
sdw::Mat4 const & | invViewProj ) |
C3D_API sdw::RetVec4 castor3d::shader::Utils::clipToScreen | ( | sdw::Vec4 const & | in | ) |
C3D_API sdw::RetVec4 castor3d::shader::Utils::computeAccumulation | ( | sdw::Float const & | depth, |
sdw::Vec3 const & | colour, | ||
sdw::Float const & | alpha, | ||
sdw::Float const & | nearPlane, | ||
sdw::Float const & | farPlane, | ||
sdw::UInt const & | accumulationOperator ) |
|
static |
C3D_API RetDerivVec3 castor3d::shader::Utils::conductorFresnel | ( | DerivFloat const & | product, |
sdw::Vec3 const & | f0 ) |
C3D_API RetDerivVec3 castor3d::shader::Utils::conductorFresnel | ( | DerivFloat const & | product, |
sdw::Vec3 const & | f0, | ||
sdw::Vec3 const & | f90 ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::conductorFresnel | ( | sdw::Float const & | product, |
sdw::Float const & | f0 ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::conductorFresnel | ( | sdw::Float const & | product, |
sdw::Float const & | f0, | ||
sdw::Float const & | f90 ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::conductorFresnel | ( | sdw::Float const & | product, |
sdw::Vec3 const & | f0 ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::conductorFresnel | ( | sdw::Float const & | product, |
sdw::Vec3 const & | f0, | ||
sdw::Vec3 const & | f90 ) |
C3D_API sdw::RetVec4 castor3d::shader::Utils::decodeColor | ( | sdw::UInt const & | colorMask | ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::decodeNormal | ( | sdw::UInt const & | normalMask | ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::distanceSquared | ( | sdw::Vec2 const | A, |
sdw::Vec2 const & | B ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::distanceSquared | ( | sdw::Vec3 const | A, |
sdw::Vec3 const & | B ) |
C3D_API sdw::RetUInt castor3d::shader::Utils::encodeColor | ( | sdw::Vec4 const & | color | ) |
Encode HDR color to a 32 bit uint. Alpha is 1 bit + 7 bit HDR remapping.
C3D_API sdw::RetVec4 castor3d::shader::Utils::encodeFloatRGBA | ( | sdw::Float const & | v | ) |
Converts a 32 bit float to store as 4 8 bit floats.
C3D_API sdw::RetUInt castor3d::shader::Utils::encodeNormal | ( | sdw::Vec3 const & | normal | ) |
Encode specified normal (normalized) into 32 bits uint. Each axis of the normal is encoded into 9 bits (1 for the sign/ 8 for the value).
C3D_API sdw::RetVec3 castor3d::shader::Utils::evalIridescence | ( | sdw::Float const & | outsideIOR, |
sdw::Float const & | eta2, | ||
sdw::Float const & | cosTheta1, | ||
sdw::Float const & | thinFilmThickness, | ||
sdw::Vec3 const & | baseF0 ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::evalSensitivity | ( | sdw::Float const & | OPD, |
sdw::Vec3 const & | shift ) |
C3D_API sdw::RetUInt castor3d::shader::Utils::flatten | ( | sdw::UVec3 const & | p, |
sdw::UVec3 const & | dim ) |
3D array index to flattened 1D array index
sdw::RetVec3 castor3d::shader::Utils::fresnel0ToIor | ( | sdw::Vec3 const & | fresnel0 | ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::fresnelMix | ( | sdw::Float const & | VdotH, |
sdw::Float const & | refractionRatio ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::fresnelMix | ( | sdw::Vec3 const & | incident, |
sdw::Vec3 const & | normal, | ||
sdw::Float const & | refractionRatio ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::fresnelToF0 | ( | sdw::Vec3 const & | fresnel, |
sdw::Float const & | VdotH ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::getMapNormal | ( | sdw::Vec2 const & | uv, |
sdw::Vec3 const & | normal, | ||
sdw::Vec3 const & | position ) |
|
static |
sdw::RetFloat castor3d::shader::Utils::iorToFresnel0 | ( | sdw::Float const & | transmittedIor, |
sdw::Float const & | incidentIor ) |
sdw::RetVec3 castor3d::shader::Utils::iorToFresnel0 | ( | sdw::Vec3 const & | transmittedIor, |
sdw::Float const & | incidentIor ) |
C3D_API sdw::RetBoolean castor3d::shader::Utils::isSaturated | ( | sdw::IVec3 const & | p, |
sdw::Int const & | imax ) |
C3D_API sdw::RetBoolean castor3d::shader::Utils::isSaturated | ( | sdw::Vec3 const & | p | ) |
C3D_API sdw::Float castor3d::shader::Utils::lineariseDepth | ( | sdw::Float const & | depth, |
sdw::Float const & | nearPlane, | ||
sdw::Float const & | farPlane ) const |
C3D_API sdw::Vec2 castor3d::shader::Utils::negateTopDownToBottomUp | ( | sdw::Vec2 const | texCoord | ) |
C3D_API sdw::Vec3 castor3d::shader::Utils::negateTopDownToBottomUp | ( | sdw::Vec3 const | texCoord | ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::negateTopDownToBottomUp | ( | sdw::Vec4 const | texCoord | ) |
C3D_API sdw::Float castor3d::shader::Utils::powder | ( | sdw::Float const | d | ) |
C3D_API sdw::Float castor3d::shader::Utils::powder | ( | sdw::Float const | d, |
sdw::Float const | cosTheta ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::reconstructCSZ | ( | sdw::Float const & | depth, |
sdw::Vec3 const | clipInfo ) |
|
static |
|
static |
C3D_API sdw::Float castor3d::shader::Utils::remap | ( | sdw::Float const | originalValue, |
sdw::Float const | originalMin, | ||
sdw::Float const | originalMax, | ||
sdw::Float const | newMin, | ||
sdw::Float const | newMax ) |
C3D_API sdw::Vec3 castor3d::shader::Utils::removeGamma | ( | sdw::Float const | gamma, |
sdw::Vec3 const | sRGB ) |
C3D_API sdw::RetFloat castor3d::shader::Utils::rescaleDepth | ( | sdw::Float const & | depth, |
sdw::Float const & | nearPlane, | ||
sdw::Float const & | farPlane ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::sampleMap | ( | sdw::CombinedImage2DRgba32 const | map, |
DerivTex const | texCoords ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::sampleMap | ( | sdw::CombinedImage2DRgba32 const | map, |
sdw::Vec2 const | texCoords ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::sampleMap | ( | sdw::CombinedImage2DRgba32 const | map, |
sdw::Vec2 const | texCoords, | ||
sdw::Float const | lod ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::sampleMap | ( | sdw::CombinedImage2DRgba32 const | map, |
sdw::Vec3 const | texCoords ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::sampleMap | ( | sdw::CombinedImage2DRgba32 const | map, |
sdw::Vec3 const | texCoords, | ||
sdw::Float const | lod ) |
C3D_API sdw::Float castor3d::shader::Utils::saturate | ( | sdw::Float const | v | ) |
C3D_API sdw::Vec3 castor3d::shader::Utils::saturate | ( | sdw::Vec3 const | v | ) |
C3D_API void castor3d::shader::Utils::swap | ( | sdw::Float const | A, |
sdw::Float const & | B ) |
C3D_API sdw::Float castor3d::shader::Utils::threshold | ( | sdw::Float const | v, |
sdw::Float const | t ) |
C3D_API sdw::Vec2 castor3d::shader::Utils::topDownToBottomUp | ( | sdw::Vec2 const | texCoord | ) |
C3D_API sdw::Vec3 castor3d::shader::Utils::topDownToBottomUp | ( | sdw::Vec3 const | texCoord | ) |
C3D_API sdw::Vec4 castor3d::shader::Utils::topDownToBottomUp | ( | sdw::Vec4 const | texCoord | ) |
C3D_API sdw::RetVec2 castor3d::shader::Utils::transformUV | ( | TextureConfigData const & | config, |
TextureTransformData const & | anim, | ||
sdw::Vec2 const | uv ) |
C3D_API sdw::RetVec3 castor3d::shader::Utils::transformUVW | ( | TextureConfigData const & | config, |
TextureTransformData const & | anim, | ||
sdw::Vec3 const | uv ) |
C3D_API sdw::RetUVec3 castor3d::shader::Utils::unflatten | ( | sdw::UInt const & | p, |
sdw::UVec3 const & | dim ) |
Flattened array index to 3D array index.