Support Forum       G3D Web Page     
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::Shader::Specification Class Reference

Consists of up to one Shader::Source per shader stage. More...

Public Member Functions

 Specification (const Any &any)
 
 Specification ()
 
 Specification (const String &f0, const String &f1="", const String &f2="", const String &f3="", const String &f4="")
 Take in between 1 and 5 filenames, each uniquely corresponding to one of the 5 stages of the shading pipeline. More...
 
 Specification (const Array< String > &filenames)
 
Sourceoperator[] (ShaderStage s)
 
const Sourceoperator[] (ShaderStage s) const
 

Protected Member Functions

void setStages (const Array< String > &filenames)
 

Protected Attributes

Source shaderStage [STAGE_COUNT]
 

Friends

class Shader
 

Detailed Description

Consists of up to one Shader::Source per shader stage.

Constructor & Destructor Documentation

◆ Specification() [1/4]

G3D::Shader::Specification::Specification ( const Any any)

◆ Specification() [2/4]

G3D::Shader::Specification::Specification ( )

◆ Specification() [3/4]

G3D::Shader::Specification::Specification ( const String f0,
const String f1 = "",
const String f2 = "",
const String f3 = "",
const String f4 = "" 
)

Take in between 1 and 5 filenames, each uniquely corresponding to one of the 5 stages of the shading pipeline.

We parse each filename, and based on the extension, load it into the specification at the corresponding stage The valid extensions are as follows:

Shader Stage Extension(s)
Vertex .vrt or .vtx
---------------------— --------------—
Tesselation Control (Hull) Shader .ctl or .hul
---------------------— --------------—
Tesselation Evaluation (Domain) Shader .evl or .dom
---------------------— --------------—
Geometry Shader .geo
---------------------— --------------—
Pixel (Fragment) Shader .pix or .frg
---------------------— --------------—
Compute Shader .glc or .glsl

If any of the strings passed in is not the empty string or a filename with this extension, an error will be thrown.

◆ Specification() [4/4]

G3D::Shader::Specification::Specification ( const Array< String > &  filenames)

Member Function Documentation

◆ operator[]() [1/2]

Source& G3D::Shader::Specification::operator[] ( ShaderStage  s)

◆ operator[]() [2/2]

const Source& G3D::Shader::Specification::operator[] ( ShaderStage  s) const

◆ setStages()

void G3D::Shader::Specification::setStages ( const Array< String > &  filenames)
protected

Friends And Related Function Documentation

◆ Shader

friend class Shader
friend

Member Data Documentation

◆ shaderStage

Source G3D::Shader::Specification::shaderStage[STAGE_COUNT]
protected

documentation generated on Wed Nov 24 2021 08:02:00 using doxygen 1.8.15