|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
Custom material with user-defined Metal vertex and fragment shader entry points. More...
#include <scene/materials/shaderMaterial.h>
Public Member Functions | |
| ShaderMaterial (const std::shared_ptr< GraphicsDevice > &device, const std::string &uniqueName, const std::string &vertexEntry="vertexShader", const std::string &fragmentEntry="fragmentShader", const std::string &sourceCode="") | |
| Public Member Functions inherited from visutwin::canvas::Material | |
| float | alphaCutoff () const |
| AlphaMode | alphaMode () const |
| const Color & | baseColorFactor () const |
| Texture * | baseColorTexture () const |
| const TextureTransform & | baseColorTransform () const |
| int | baseColorUvSet () const |
| const std::shared_ptr< BlendState > & | blendState () const |
| void | clearParameters () |
| CullMode | cullMode () const |
| virtual const void * | customUniformData (size_t &outSize) const |
| const std::shared_ptr< DepthState > & | depthState () const |
| const Color & | emissiveFactor () const |
| Texture * | emissiveTexture () const |
| const TextureTransform & | emissiveTransform () const |
| int | emissiveUvSet () const |
| virtual void | getTextureSlots (std::vector< TextureSlot > &slots) const |
| bool | hasBaseColorTexture () const |
| bool | hasEmissiveTexture () const |
| bool | hasMetallicRoughnessTexture () const |
| bool | hasNormalTexture () const |
| bool | hasOcclusionTexture () const |
| bool | isSkybox () const |
| Material () | |
| float | metallicFactor () const |
| Texture * | metallicRoughnessTexture () const |
| int | metallicRoughnessUvSet () const |
| const TextureTransform & | metalRoughTransform () const |
| const std::string & | name () const |
| float | normalScale () const |
| Texture * | normalTexture () const |
| const TextureTransform & | normalTransform () const |
| int | normalUvSet () const |
| bool | occludeDirect () const |
| uint32_t | occludeSpecular () const |
| float | occludeSpecularIntensity () const |
| float | occlusionStrength () const |
| Texture * | occlusionTexture () const |
| const TextureTransform & | occlusionTransform () const |
| int | occlusionUvSet () const |
| const ParameterValue * | parameter (const std::string &name) const |
| const std::unordered_map< std::string, ParameterValue > & | parameters () const |
| bool | removeParameter (const std::string &name) |
| float | roughnessFactor () const |
| void | setAlphaCutoff (const float value) |
| void | setAlphaMode (const AlphaMode mode) |
| void | setBaseColorFactor (const Color &value) |
| void | setBaseColorTexture (Texture *texture) |
| void | setBaseColorTransform (const TextureTransform &t) |
| void | setBaseColorUvSet (const int uvSet) |
| void | setBlendState (const std::shared_ptr< BlendState > &blendState) |
| void | setCullMode (const CullMode mode) |
| void | setDepthState (const std::shared_ptr< DepthState > &depthState) |
| void | setEmissiveFactor (const Color &value) |
| void | setEmissiveTexture (Texture *texture) |
| void | setEmissiveTransform (const TextureTransform &t) |
| void | setEmissiveUvSet (const int uvSet) |
| void | setHasBaseColorTexture (const bool value) |
| void | setHasEmissiveTexture (const bool value) |
| void | setHasMetallicRoughnessTexture (const bool value) |
| void | setHasNormalTexture (const bool value) |
| void | setHasOcclusionTexture (const bool value) |
| void | setIsSkybox (const bool value) |
| void | setMetallicFactor (const float value) |
| void | setMetallicRoughnessTexture (Texture *texture) |
| void | setMetallicRoughnessUvSet (const int uvSet) |
| void | setMetalRoughTransform (const TextureTransform &t) |
| void | setName (const std::string &name) |
| void | setNormalScale (const float value) |
| void | setNormalTexture (Texture *texture) |
| void | setNormalTransform (const TextureTransform &t) |
| void | setNormalUvSet (const int uvSet) |
| void | setOccludeDirect (const bool value) |
| void | setOccludeSpecular (const uint32_t value) |
| void | setOccludeSpecularIntensity (const float value) |
| void | setOcclusionStrength (const float value) |
| void | setOcclusionTexture (Texture *texture) |
| void | setOcclusionTransform (const TextureTransform &t) |
| void | setOcclusionUvSet (const int uvSet) |
| void | setParameter (const std::string &name, const ParameterValue &value) |
| void | setRoughnessFactor (const float value) |
| void | setShaderOverride (const std::shared_ptr< Shader > &shader) |
| void | setShaderVariantKey (const uint64_t value) |
| void | setTransparent (const bool value) |
| const std::shared_ptr< Shader > & | shaderOverride () const |
| uint64_t | shaderVariantKey () const |
| uint64_t | sortKey () const |
| bool | transparent () const |
| virtual void | updateUniforms (MaterialUniforms &uniforms) const |
| virtual | ~Material ()=default |
Additional Inherited Members | |
| Public Types inherited from visutwin::canvas::Material | |
| using | ParameterValue = std::variant<float, int32_t, uint32_t, bool, Color, Vector2, Vector3, Vector4, Matrix4, Texture*> |
Custom material with user-defined Metal vertex and fragment shader entry points.
ShaderMaterial allows injecting arbitrary Metal shader source code with named entry points, bypassing the standard PBR chunk composition pipeline.
Definition at line 24 of file shaderMaterial.h.
| visutwin::canvas::ShaderMaterial::ShaderMaterial | ( | const std::shared_ptr< GraphicsDevice > & | device, |
| const std::string & | uniqueName, | ||
| const std::string & | vertexEntry = "vertexShader", | ||
| const std::string & | fragmentEntry = "fragmentShader", | ||
| const std::string & | sourceCode = "" ) |
Definition at line 13 of file shaderMaterial.cpp.
References visutwin::canvas::createShader(), visutwin::canvas::ShaderDefinition::fshader, visutwin::canvas::ShaderDefinition::name, visutwin::canvas::Material::setName(), visutwin::canvas::Material::setShaderOverride(), visutwin::canvas::Material::setTransparent(), and visutwin::canvas::ShaderDefinition::vshader.