ImFusion C++ SDK 4.4.0

Interfaces and wrapper classes for working with OpenGL/GLSL shaders. More...

Collaboration diagram for GLSL Shaders:

Detailed Description

Interfaces and wrapper classes for working with OpenGL/GLSL shaders.

OpenGL shaders are user-defined programs that are executed on the GPU as part of a certain rendering pipeline stage. Please refer to the OpenGL Wiki for more information on the technical details how shader execution on the GPU works.

For basic rendering tasks you can use the GL::FixedFunctionPipeline class providing general-purpose rendering capabilities for points, lines, and triangles. If those are not sufficient or need to implement a custom shader yourself. The GL::Program class represents the wrapper class for this concept and is formed of one or multiple shaders. The GL::ImageProgram class is a specialization to conveniently execute a fragment shader on a 2D or 3D image (or a sub region of it) in a pixel-perfect fashion.

Shader source code is provided by the Resource System infrastructure. By default, the source code is staticly defined at compile time of your application. However, ImFusionGL provides different mechanisms to flexibly assemble the final source code, optionally also in a polymorphic fashion at runtime:

  • A regular include mechanism allows for assemble the final source code from multiple static source code pieces. This allows for easy reusing of GLSL code.
  • The GL::ProgramDecorator interface enables you to control runtime state of a GL::Program (such as uniform values) from the outside.
  • The GL::AbstractInclude interface provides a very powerful mechanism to achieve runtime polymorphism in a shader in the sense that the final shader code is not statically defined at compile time (as with the regular include mechanism) but at runtime instead. The GL::MultiIncludable interface provides an extension to this enabling you to use multiple instances of the same GL::AbstractInclude type in a single shader.

Classes

class  ImFusion::GL::AbstractInclude
 Base class for abstract GLSL includes. More...
class  ImFusion::GL::ImageProgram
 Convenience class to execute a GLSL fragment shader on an image or volume. More...
class  ImFusion::GL::MultiIncludable< BaseIncludeType, IncludeArgumentsTypes >
 Multi-AbstractIncludes allow for using multiple instances of the same AbstractInclude type in one shader. More...
class  ImFusion::GL::MultiAbstractIncludeBase
 Non-templated base class of MultiIncludable to implement polymorphic interface. More...
class  ImFusion::GL::MultiAbstractInclude< BaseIncludeType, IncludeArgumentsTypes >
 Concrete type for an instance of a Multi-AbstractInclude. More...
class  ImFusion::GL::Program
 OpenGL GLSL program with a fragment and optional vertex and geometry shader. More...
class  ImFusion::GL::ProgramCache
 Helper class to manage instances of the same base shader with different abstract includes and/or defines. More...
class  ImFusion::GL::ProgramDecorator
 Interface to apply custom arguments to a shader program. More...

Enumerations

enum class  ImFusion::GL::ShaderTextReplacement { ImFusion::GL::ShaderTextReplacement::ExactMatch = 1 << 0 , ImFusion::GL::ShaderTextReplacement::AllUppercase = 1 << 1 , ImFusion::GL::ShaderTextReplacement::AllLowercase = 1 << 2 }
 Bitfield enum describing how to perform text replacement in a shader when using the MultiIncludable interface. More...

Enumeration Type Documentation

◆ ShaderTextReplacement

#include <ImFusion/Core/GL/MultiAbstractInclude.h>

Bitfield enum describing how to perform text replacement in a shader when using the MultiIncludable interface.

Enumerator
ExactMatch 

Replace exact matches of the base token with the replacement token.

AllUppercase 

Replace matches of toUpper(baseToken) with the replacement token.

AllLowercase 

Replace matches of toLower(baseToken) with the replacement token.

Search Tab / S to search, Esc to close