MaterialX 1.38.2
LightCompoundNodeGlsl.h
1//
2// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_LIGHTCOMPOUNDNODEGLSL_H
7#define MATERIALX_LIGHTCOMPOUNDNODEGLSL_H
8
9#include <MaterialXGenShader/Nodes/CompoundNode.h>
12
13namespace MaterialX
14{
15
16class GlslShaderGenerator;
17
20{
21public:
23
24 static ShaderNodeImplPtr create();
25
26 const string& getTarget() const override;
27
28 void initialize(const InterfaceElement& element, GenContext& context) override;
29
30 void createVariables(const ShaderNode& node, GenContext& context, Shader& shader) const override;
31
32 void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
33
34 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
35
36protected:
37 void emitFunctionDefinition(HwClosureContextPtr ccx, GenContext& context, ShaderStage& stage) const;
38
39 VariableBlock _lightUniforms;
40};
41
42} // namespace MaterialX
43
44#endif
Hardware shader generator base class.
shared_ptr< class HwClosureContext > HwClosureContextPtr
Shared pointer to a HwClosureContext.
Definition: HwShaderGenerator.h:229
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Shader instance class created during shader generation.
Compound node implementation.
Definition: CompoundNode.h:18
A context class for shader generation.
Definition: GenContext.h:27
The base class for interface elements such as Node, NodeDef, and NodeGraph.
Definition: Interface.h:317
LightCompound node implementation for GLSL.
Definition: LightCompoundNodeGlsl.h:20
const string & getTarget() const override
Return an identifier for the target used by this implementation.
Definition: LightCompoundNodeGlsl.cpp:24
void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit function definition for the given node instance.
Definition: LightCompoundNodeGlsl.cpp:64
void emitFunctionCall(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit the function call or inline source code for given node instance in the given context.
Definition: LightCompoundNodeGlsl.cpp:137
void initialize(const InterfaceElement &element, GenContext &context) override
Initialize with the given implementation element.
Definition: LightCompoundNodeGlsl.cpp:29
void createVariables(const ShaderNode &node, GenContext &context, Shader &shader) const override
Create shader variables needed for the implementation of this node (e.g.
Definition: LightCompoundNodeGlsl.cpp:42
Class containing all data needed during shader generation.
Definition: Shader.h:34
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:326
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:124
A block of variables in a shader stage.
Definition: ShaderStage.h:53