Castor3D 0.12.0
Multiplatform 3D engine
|
#include <GlslUtils.hpp>
Fonctions membres publiques | |
C3D_API | Utils (sdw::ShaderWriter &writer, Engine const &engine) |
C3D_API LightingModelPtr | createLightingModel (castor::String const &name, ShadowOptions shadowsOptions, SssProfiles const *sssProfiles, bool isOpaqueProgram) |
C3D_API void | swap (sdw::Float const A, sdw::Float const &B) |
C3D_API sdw::Float | saturate (sdw::Float const v) |
C3D_API sdw::Vec3 | saturate (sdw::Vec3 const v) |
C3D_API sdw::Float | distanceSquared (sdw::Vec2 const A, sdw::Vec2 const &B) |
C3D_API sdw::Float | distanceSquared (sdw::Vec3 const A, sdw::Vec3 const &B) |
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 | calcVSPosition (sdw::Vec2 const &uv, sdw::Float const &depth, sdw::Mat4 const &invProj) |
C3D_API sdw::Vec3 | calcWSPosition (sdw::Vec2 const &uv, sdw::Float const &depth, sdw::Mat4 const &invViewProj) |
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::Vec3 | getMapNormal (sdw::Vec2 const &uv, sdw::Vec3 const &normal, sdw::Vec3 const &position) |
C3D_API sdw::Float | rescaleDepth (sdw::Float const &depth, sdw::Float const &nearPlane, sdw::Float const &farPlane) |
C3D_API sdw::Vec4 | computeAccumulation (sdw::Float const &depth, sdw::Vec3 const &colour, sdw::Float const &alpha, sdw::Float const &nearPlane, sdw::Float const &farPlane, sdw::Float const &accumulationOperator) |
C3D_API sdw::Vec3 | fresnelSchlick (sdw::Float const &product, sdw::Vec3 const &f0) |
C3D_API void | compute2DMapsContributions (FilteredTextureFlags const &flags, TextureConfigurations const &textureConfigs, TextureAnimations const &textureAnims, sdw::Array< sdw::CombinedImage2DRgba32 > const &maps, sdw::Vec3 const &texCoords, sdw::Vec3 &colour, sdw::Float &opacity) |
C3D_API sdw::Vec2 | parallaxMapping (sdw::Vec2 const &texCoords, sdw::Vec3 const &viewDir, sdw::CombinedImage2DRgba32 const &heightMap, TextureConfigData const &textureConfig) |
C3D_API sdw::Vec4 | clipToScreen (sdw::Vec4 const &in) |
C3D_API void | applyAlphaFunc (VkCompareOp alphaFunc, sdw::Float &alpha, sdw::Float const &alphaRef, bool opaque=true) |
Ecrit la fonction d'opacité en GLSL. Plus de détails... | |
C3D_API sdw::Boolean | isSaturated (sdw::Vec3 const &p) |
C3D_API sdw::Boolean | isSaturated (sdw::IVec3 const &p, sdw::Int const &imax) |
C3D_API sdw::UInt | encodeColor (sdw::Vec4 const &color) |
C3D_API sdw::UInt | encodeNormal (sdw::Vec3 const &normal) |
C3D_API sdw::Vec4 | decodeColor (sdw::UInt const &colorMask) |
C3D_API sdw::Vec3 | decodeNormal (sdw::UInt const &normalMask) |
C3D_API sdw::UInt | flatten (sdw::UVec3 const &p, sdw::UVec3 const &dim) |
C3D_API sdw::UVec3 | unflatten (sdw::UInt const &p, sdw::UVec3 const &dim) |
Fonctions membres publiques statiques | |
static C3D_API sdw::Mat3 | getTBN (sdw::Vec3 const &normal, sdw::Vec3 const &tangent, sdw::Vec3 const &bitangent) |
static C3D_API bool | isGeometryMap (TextureFlags const &flags, PassFlags const &passFlags) |
static C3D_API bool | isGeometryOnlyMap (TextureFlags const &flags, PassFlags const &passFlags) |
|
explicit |
C3D_API void castor3d::shader::Utils::applyAlphaFunc | ( | VkCompareOp | alphaFunc, |
sdw::Float & | alpha, | ||
sdw::Float const & | alphaRef, | ||
bool | opaque = true |
||
) |
Ecrit la fonction d'opacité en GLSL.
alphaFunc | La fonction d'opacité. | |
[in] | alpha | La valeur d'opacité. |
[in] | alphaRef | La valeur de référence pour la comparaison alpha. |
[in] | opaque | true pour les noeuds opaques, false pour les transparents. |
C3D_API sdw::Vec3 castor3d::shader::Utils::applyGamma | ( | sdw::Float const & | gamma, |
sdw::Vec3 const & | HDR | ||
) |
C3D_API sdw::Vec2 castor3d::shader::Utils::calcTexCoord | ( | sdw::Vec2 const & | renderPos, |
sdw::Vec2 const & | renderSize | ||
) |
C3D_API sdw::Vec3 castor3d::shader::Utils::calcVSPosition | ( | sdw::Vec2 const & | uv, |
sdw::Float const & | depth, | ||
sdw::Mat4 const & | invProj | ||
) |
C3D_API sdw::Vec3 castor3d::shader::Utils::calcWSPosition | ( | sdw::Vec2 const & | uv, |
sdw::Float const & | depth, | ||
sdw::Mat4 const & | invViewProj | ||
) |
C3D_API sdw::Vec4 castor3d::shader::Utils::clipToScreen | ( | sdw::Vec4 const & | in | ) |
C3D_API void castor3d::shader::Utils::compute2DMapsContributions | ( | FilteredTextureFlags const & | flags, |
TextureConfigurations const & | textureConfigs, | ||
TextureAnimations const & | textureAnims, | ||
sdw::Array< sdw::CombinedImage2DRgba32 > const & | maps, | ||
sdw::Vec3 const & | texCoords, | ||
sdw::Vec3 & | colour, | ||
sdw::Float & | opacity | ||
) |
C3D_API sdw::Vec4 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::Float const & | accumulationOperator | ||
) |
C3D_API LightingModelPtr castor3d::shader::Utils::createLightingModel | ( | castor::String const & | name, |
ShadowOptions | shadowsOptions, | ||
SssProfiles const * | sssProfiles, | ||
bool | isOpaqueProgram | ||
) |
C3D_API sdw::Vec4 castor3d::shader::Utils::decodeColor | ( | sdw::UInt const & | colorMask | ) |
C3D_API sdw::Vec3 castor3d::shader::Utils::decodeNormal | ( | sdw::UInt const & | normalMask | ) |
C3D_API sdw::Float castor3d::shader::Utils::distanceSquared | ( | sdw::Vec2 const | A, |
sdw::Vec2 const & | B | ||
) |
C3D_API sdw::Float castor3d::shader::Utils::distanceSquared | ( | sdw::Vec3 const | A, |
sdw::Vec3 const & | B | ||
) |
C3D_API sdw::UInt castor3d::shader::Utils::encodeColor | ( | sdw::Vec4 const & | color | ) |
C3D_API sdw::UInt castor3d::shader::Utils::encodeNormal | ( | sdw::Vec3 const & | normal | ) |
C3D_API sdw::UInt castor3d::shader::Utils::flatten | ( | sdw::UVec3 const & | p, |
sdw::UVec3 const & | dim | ||
) |
C3D_API sdw::Vec3 castor3d::shader::Utils::fresnelSchlick | ( | sdw::Float const & | product, |
sdw::Vec3 const & | f0 | ||
) |
C3D_API sdw::Vec3 castor3d::shader::Utils::getMapNormal | ( | sdw::Vec2 const & | uv, |
sdw::Vec3 const & | normal, | ||
sdw::Vec3 const & | position | ||
) |
|
static |
|
static |
|
static |
C3D_API sdw::Boolean castor3d::shader::Utils::isSaturated | ( | sdw::IVec3 const & | p, |
sdw::Int const & | imax | ||
) |
C3D_API sdw::Boolean castor3d::shader::Utils::isSaturated | ( | sdw::Vec3 const & | p | ) |
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::Vec2 castor3d::shader::Utils::parallaxMapping | ( | sdw::Vec2 const & | texCoords, |
sdw::Vec3 const & | viewDir, | ||
sdw::CombinedImage2DRgba32 const & | heightMap, | ||
TextureConfigData const & | textureConfig | ||
) |
C3D_API sdw::Vec3 castor3d::shader::Utils::removeGamma | ( | sdw::Float const & | gamma, |
sdw::Vec3 const & | sRGB | ||
) |
C3D_API sdw::Float castor3d::shader::Utils::rescaleDepth | ( | sdw::Float const & | depth, |
sdw::Float const & | nearPlane, | ||
sdw::Float const & | farPlane | ||
) |
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::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::UVec3 castor3d::shader::Utils::unflatten | ( | sdw::UInt const & | p, |
sdw::UVec3 const & | dim | ||
) |