ZeroZero Game Engine  v0.0
A 3D game engine using Vulkan & Jolt
Public Member Functions | Static Public Attributes | List of all members
ShaderMaterial Class Reference

Detailed Description

Shader based material

Inheritance diagram for ShaderMaterial:
Material Resource Object

Public Member Functions

 ShaderMaterial (const shared_ptr< ShaderMaterial > &orig)
 
 ShaderMaterial (const string &fragShaderFileName, const string &vertShaderFileName="", const string &name="ShaderMaterial")
 
const auto & getFragFileName () const
 
const auto & getVertFileName () const
 
void setParameter (int index, vec4 value)
 
auto getParameter (const int index) const
 
- Public Member Functions inherited from Material
auto getCullMode () const
 
void setCullMode (const CullMode mode)
 
auto getTransparency () const
 
void setTransparency (const Transparency transparencyMode)
 
auto getAlphaScissor () const
 
void setAlphaScissor (const float scissor)
 
- Public Member Functions inherited from Resource
auto getId () const
 
const auto & getName () const
 
string toString () const override
 
virtual shared_ptr< Resource > duplicate () const
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 

Static Public Attributes

static constexpr int MAX_PARAMETERS = 4
 

Constructor & Destructor Documentation

ShaderMaterial ( const shared_ptr< ShaderMaterial > &  orig)
explicit

Creates a ShaderMaterial by copy

ShaderMaterial ( const string &  fragShaderFileName,
const string &  vertShaderFileName = "",
const string &  name = "ShaderMaterial" 
)
explicit

Creates a ShaderMaterial

Parameters
fragShaderFileNamefragment shader file path, relative to the application directory
vertShaderFileNamevertex shader file path, relative to the application directory
nameResource name

Member Function Documentation

const auto& getFragFileName ( ) const
nodiscardinline

Returns the fragment shader file path, relative to the application directory

auto getParameter ( const int  index) const
nodiscardinline

Returns a parameter value

const auto& getVertFileName ( ) const
nodiscardinline

Returns the vertex shader file path, relative to the application directory

void setParameter ( int  index,
vec4  value 
)

Sets a parameter value

Member Data Documentation

constexpr int MAX_PARAMETERS = 4
staticconstexpr

Maximum number of parameters of a ShaderMaterial