![]() |
ImFusion SDK 4.3
|
#include <ImFusion/ImageMath/OpenGL/GlExpr.h>
Wrapper for using a ExprBase as GlAbstractInclude. More...
Inheritance diagram for GlExpr:Wrapper for using a ExprBase as GlAbstractInclude.
GlExpr provides GlAbstractInclude which can be used in a GlProgram. The GlAbstractInclude defines "EXPR" and a method with the following signature (see SharedImageSetArithmetic.glh)
The index can be used in case of SharedImageSets in order to index the image you are evaluating. This class also provides setIndices() in order to choose which SharedImages of a SharedImageSet are supposed to be bound.
Example: SharedImageSetArithmetic.frag:
Now in c++ any expression can be used in this shader by:
Public Member Functions | |
| GlExpr (const internal::GlExprInterface &expr) | |
| std::function< std::string(const std::string &)> | includeCodeSubstitution () const override |
| Replaces any occurrence of UNIFORMS_IMPL with the uniform definition and any occurrence of EXPR_IMPL with the actual expression. | |
| int | setIncludeArguments (GL::Program &p, const std::string &prefix="expr") const override |
| Fingerprint | fingerprint () const override |
| Provides a finger print of the include. | |
| void | setIndices (std::vector< int > indices) |
| Set the indices which shall be considered in case of a SharedImageSet () | |
| int | numRequiredSamplersPerIndex () |
| Returns how many samplers are required per index. | |
| const internal::GlExprInterface & | expr () const |
| Get wrapped expression. | |
Public Member Functions inherited from AbstractInclude | |
| AbstractInclude (const std::string &defineName, const std::string &includePath) | |
| Creates a AbstractInclude for the given define and with the corresponding GLSL file at includePath. | |
| const std::string & | defineName () const |
| Returns the name of define used by this include. | |
| const std::string & | includePath () const |
| Returns the path to the included shader file. | |
| virtual std::vector< AbstractInclude * > | dependentIncludes () const |
| Returns a list of dependent abstract includes that need to be included as well. | |
Public Member Functions inherited from MultiIncludable< GlExpr > | |
| std::shared_ptr< MultiIncludeType > | createMultiInclude (const std::string &replacementToken) |
| Instantiates a new AbstractInclude instance where all occurrences of baseToken provided during construction are replaces with replacementToken according to the specified replacementScheme. | |
| virtual int | setIncludeArguments (Program &prog, IncludeArgumentsTypes... includeArgs, const std::string &token) const=0 |
| Interface that multi includes should use to configure the shader include (such as setting uniforms, binding textures, etc). | |
Static Public Member Functions | |
| static std::string | defineName () |
| Returns "EXPR". | |
| static std::string | defineSuffix () |
| Returns "EXPR". | |
Additional Inherited Members | |
Public Types inherited from MultiIncludable< GlExpr > | |
| using | MultiIncludeType |
| Alias for type of a multi-include instance of the original include. | |
Protected Member Functions inherited from MultiIncludable< GlExpr > | |
| MultiIncludable (GlExpr *crtpInstance, const std::string &baseToken, Flags< ShaderTextReplacement > replacementScheme) | |
| Instantiate and configure the MultiIncludable interface. | |
|
overridevirtual |
Replaces any occurrence of UNIFORMS_IMPL with the uniform definition and any occurrence of EXPR_IMPL with the actual expression.
Reimplemented from AbstractInclude.
|
overridevirtual |
Provides a finger print of the include.
If two finger prints are equal this means that the two includes provide the very same code substitution. It does NOT mean that the two includes are equal. In particular the result of setArguments can be different.
Reimplemented from AbstractInclude.