VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
visutwin::canvas::ShaderMaterial Class Reference

Custom material with user-defined Metal vertex and fragment shader entry points. More...

#include <scene/materials/shaderMaterial.h>

Inheritance diagram for visutwin::canvas::ShaderMaterial:
[legend]

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 ColorbaseColorFactor () const
TexturebaseColorTexture () const
const TextureTransformbaseColorTransform () 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 ColoremissiveFactor () const
TextureemissiveTexture () const
const TextureTransformemissiveTransform () 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
TexturemetallicRoughnessTexture () const
int metallicRoughnessUvSet () const
const TextureTransformmetalRoughTransform () const
const std::string & name () const
float normalScale () const
TexturenormalTexture () const
const TextureTransformnormalTransform () const
int normalUvSet () const
bool occludeDirect () const
uint32_t occludeSpecular () const
float occludeSpecularIntensity () const
float occlusionStrength () const
TextureocclusionTexture () const
const TextureTransformocclusionTransform () const
int occlusionUvSet () const
const ParameterValueparameter (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*>

Detailed Description

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.

Constructor & Destructor Documentation

◆ ShaderMaterial()

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 = "" )

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