12 #ifndef SLGLPROGRAMMGENERATED_H
13 #define SLGLPROGRAMMGENERATED_H
60 const string& programName,
75 const string& programName,
100 string& programName);
108 bool drawInstanced =
false);
111 SLbool supportGPUSkinning);
137 const std::string&
name,
138 const std::string& value);
vector< SLLight * > SLVLight
STL vector of light pointers.
Toplevel holder of the assets meshes, materials, textures and shaders.
Active or visible camera node class.
Generated Shader Program class inherited from SLGLProgram.
static string fragInput_u_lightSm(SLVLight *lights)
void buildPerPixParticleUpdate(SLMaterial *mat)
static bool lightsDoShadowMapping(SLVLight *lights)
Returns true if at least one of the light does shadow mapping.
static void addCodeToShader(SLGLShader *shader, const string &code, const string &name)
Add vertex shader code to the SLGLShader instance.
~SLGLProgramGenerated() override=default
SLGLProgramGenerated(SLAssetManager *am, const string &programName, SLMaterial *mat, bool isDrawProg, SLstring geomShader="")
ctor for generated shader program PS
static void setVariable(std::string &code, const std::string &name, const std::string &value)
Sets a variable in the shader code.
void buildPerPixCook(SLMaterial *mat, SLVLight *lights, SLbool supportGPUSkinning)
void buildPerPixBlinn(SLMaterial *mat, SLVLight *lights, SLbool supportGPUSkinning)
SLGLProgramGenerated(SLAssetManager *am, const string &programName, SLMaterial *mat, SLVLight *lights, SLbool supportGPUSkinning)
ctor for generated shader program
void endShader() override
static string generatedShaderPath
static string fragFunctionShadowTest(SLVLight *lights)
Adds the core shadow mapping test routine depending on the lights.
static string shaderHeader()
Adds shader header code.
void buildProgramCode(SLMaterial *mat, SLVLight *lights, SLbool supportGPUSkinning)
static void buildProgramNamePS(SLMaterial *mat, string &programName, bool isDrawProg, bool drawInstanced)
static void buildProgramName(SLMaterial *mat, SLVLight *lights, SLbool supportGPUSkinning, string &programName)
Builds unique program name that identifies shader program.
void beginShader(SLCamera *cam, SLMaterial *mat, SLVLight *lights) override
starter for derived classes
void buildProgramCodePS(SLMaterial *mat, bool isDrawProg, bool drawInstanced=false)
void buildPerPixParticle(SLMaterial *mat)
void buildPerPixParticleInstanced(SLMaterial *mat)
static string fragInput_u_shadowMaps(SLVLight *lights)
void buildPerPixVideoBkgdSm(SLVLight *lights)
Assemble shaders for video on background.
Encapsulation of an OpenGL shader program object.
void beginUse(SLCamera *cam, SLMaterial *mat, SLVLight *lights)
void endUse()
SLGLProgram::endUse stops the shader program.
Encapsulation of an OpenGL shader object.
Defines a standard CG material with textures and a shader program.
const SLstring & name() const