MaterialX 1.39.1
Loading...
Searching...
No Matches
LightCompoundNodeGlsl.h
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_LIGHTCOMPOUNDNODEGLSL_H
7#define MATERIALX_LIGHTCOMPOUNDNODEGLSL_H
8
10
11#include <MaterialXGenShader/Nodes/CompoundNode.h>
14
15MATERIALX_NAMESPACE_BEGIN
16
18
20class MX_GENGLSL_API LightCompoundNodeGlsl : public CompoundNode
21{
22 public:
24
25 static ShaderNodeImplPtr create();
26
27 const string& getTarget() const override;
28
29 void initialize(const InterfaceElement& element, GenContext& context) override;
30
31 void createVariables(const ShaderNode& node, GenContext& context, Shader& shader) const override;
32
33 void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
34
35 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
36
37 protected:
38 void emitFunctionDefinition(ClosureContext* cct, GenContext& context, ShaderStage& stage) const;
39
40 VariableBlock _lightUniforms;
41};
42
43MATERIALX_NAMESPACE_END
44
45#endif
Context classes for shader generation.
Macros for declaring imported and exported symbols.
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Shader instance class created during shader generation.
Class representing a context for closure evaluation.
Definition: GenContext.h:248
Compound node implementation.
Definition: CompoundNode.h:17
void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit function definition for the given node instance.
A context class for shader generation.
Definition: GenContext.h:31
Base class for GLSL (OpenGL Shading Language) code generation.
Definition: GlslShaderGenerator.h:23
The base class for interface elements such as Node, NodeDef, and NodeGraph.
Definition: Interface.h:312
LightCompound node implementation for GLSL.
Definition: LightCompoundNodeGlsl.h:21
const string & getTarget() const override
Return an identifier for the target used by this implementation.
void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit function definition for the given node instance.
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.
void initialize(const InterfaceElement &element, GenContext &context) override
Initialize with the given implementation element.
void createVariables(const ShaderNode &node, GenContext &context, Shader &shader) const override
Create shader variables needed for the implementation of this node (e.g.
Class containing all data needed during shader generation.
Definition: Shader.h:33
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:320
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:139
A block of variables in a shader stage.
Definition: ShaderStage.h:61