Gamp v0.0.7-54-gccdc599
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::graph::gl::GraphRenderer Class Reference

OpenGL GraphRenderer. More...

#include <GraphRenderer.hpp>

Collaboration diagram for gamp::graph::gl::GraphRenderer:

Public Types

typedef jau::function< bool(GL &gl, GraphRenderer &renderer)> GLCallback
 May be passed to <?
 

Public Member Functions

 GraphRenderer (jau::math::util::PMVMat4f &pmvMat)
 
constexpr bool initialized () const noexcept
 
const RenderStaterenderState () const noexcept
 
RenderStaterenderState () noexcept
 
const Rectiviewport () const noexcept
 

Static Public Attributes

static constexpr std::string_view bin_dir = "impl/graph/glsl/bin"
 
static constexpr std::string_view colTexLookupFuncName = "texture2D"
 
static constexpr bool DEBUG_MODE = true
 
static GLCallback defaultBlendDisable
 Default GL#GL_BLEND disable GLCallback, simply turning-off the GL#GL_BLEND state and turning-on depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set.
 
static GLCallback defaultBlendEnable
 Default GL#GL_BLEND enable GLCallback, turning-off depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set and turning-on the GL#GL_BLEND state.
 
static constexpr std::string_view gcuTexture2D = "gcuTexture2D"
 
static constexpr std::string_view GLSL_CONST_SAMPLE_COUNT = "const float sample_count = "
 
static constexpr std::string_view GLSL_DEF_SAMPLE_COUNT = "#define SAMPLE_COUNT "
 
static constexpr std::string_view GLSL_MAIN_BEGIN = "void main (void)\n{\n"
 
static constexpr std::string_view GLSL_PARAM_COMMENT_END = "// Gamp Graph Parameter End\n\n"
 
static constexpr std::string_view GLSL_PARAM_COMMENT_START = "\n// Gamp Graph Parameter Start\n"
 
static constexpr std::string_view GLSL_USE_COLOR_CHANNEL = "#define USE_COLOR_CHANNEL 1\n"
 
static constexpr std::string_view GLSL_USE_COLOR_TEXTURE = "#define USE_COLOR_TEXTURE 1\n"
 
static constexpr std::string_view GLSL_USE_DISCARD = "#define USE_DISCARD 1\n"
 
static constexpr std::string_view GLSL_USE_FRUSTUM_CLIPPING = "#define USE_FRUSTUM_CLIPPING 1\n"
 
static constexpr std::string_view GLSL_USE_LIGHT0 = "#define USE_LIGHT0 1\n"
 
static constexpr std::string_view GLSL_USE_NORMAL_CHANNEL = "#define USE_NORMAL_CHANNEL 1\n"
 
static constexpr std::string_view shader_basename = "curverenderer01"
 
static constexpr std::string_view source_dir = "impl/graph/glsl"
 

Detailed Description

OpenGL GraphRenderer.

All GraphRegion rendering operations utilize a GraphRenderer.

The GraphRenderer owns its RenderState, a composition.

The GraphRenderer manages and owns all used ShaderProgram instances, a composition.

At its destruction, all ShaderPrograms and its RenderState will be destroyed and released.

Definition at line 52 of file GraphRenderer.hpp.

Member Typedef Documentation

◆ GLCallback

May be passed to <?

extends Vertex>, RenderState, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback) RegionRenderer ctor}, e.g.

Parameters
gla current GL context
rendererGraphRenderer calling this method.

Definition at line 66 of file GraphRenderer.hpp.

Constructor & Destructor Documentation

◆ GraphRenderer()

gamp::graph::gl::GraphRenderer::GraphRenderer ( jau::math::util::PMVMat4f & pmvMat)
inline

Definition at line 113 of file GraphRenderer.hpp.

Member Function Documentation

◆ renderState() [1/2]

const RenderState & gamp::graph::gl::GraphRenderer::renderState ( ) const
inlinenoexcept

Definition at line 118 of file GraphRenderer.hpp.

Here is the caller graph for this function:

◆ renderState() [2/2]

RenderState & gamp::graph::gl::GraphRenderer::renderState ( )
inlinenoexcept

Definition at line 119 of file GraphRenderer.hpp.

◆ viewport()

const Recti & gamp::graph::gl::GraphRenderer::viewport ( ) const
inlinenoexcept

Definition at line 120 of file GraphRenderer.hpp.

◆ initialized()

bool gamp::graph::gl::GraphRenderer::initialized ( ) const
inlineconstexprnoexcept

Definition at line 121 of file GraphRenderer.hpp.

Member Data Documentation

◆ defaultBlendEnable

GraphRenderer::GLCallback GraphRenderer::defaultBlendEnable
static
Initial value:
= [](GL&, GraphRenderer& renderer) {
if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
::glDepthMask(false);
}
::glEnable(GL_BLEND);
::glBlendEquation(GL_FUNC_ADD);
renderer.renderState().setHintBits(RenderState::BITHINT_BLENDING_ENABLED);
}
GraphRenderer(jau::math::util::PMVMat4f &pmvMat)
static constexpr int BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint, if set stating globally enabled GL#GL_DEPTH_TEST, otherwise disabled.
static constexpr int BITHINT_BLENDING_ENABLED
Bitfield hint, if set stating enabled GL#GL_BLEND, otherwise disabled.

Default GL#GL_BLEND enable GLCallback, turning-off depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set and turning-on the GL#GL_BLEND state.

Implementation also sets RenderState's blending bit-hint, which will cause GLRegion's draw-method to set the proper blend-function and the clear-color to transparent-black in case of multipass FBO rendering.

See also
#create(GLCallback, GLCallback)
#enable(GL2ES2, bool)

Definition at line 81 of file GraphRenderer.hpp.

◆ defaultBlendDisable

GraphRenderer::GLCallback GraphRenderer::defaultBlendDisable
static
Initial value:
= [](GL&, GraphRenderer& renderer) {
renderer.renderState().clearHintBits(RenderState::BITHINT_BLENDING_ENABLED);
::glDisable(GL_BLEND);
if( renderer.renderState().hintBitsSet(RenderState::BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
::glDepthMask(true);
}
}

Default GL#GL_BLEND disable GLCallback, simply turning-off the GL#GL_BLEND state and turning-on depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set.

Implementation also clears RenderState's blending bit-hint.

See also
#create(GLCallback, GLCallback)
#enable(GL2ES2, bool)

Definition at line 93 of file GraphRenderer.hpp.

◆ DEBUG_MODE

bool gamp::graph::gl::GraphRenderer::DEBUG_MODE = true
staticconstexpr

Definition at line 95 of file GraphRenderer.hpp.

◆ GLSL_PARAM_COMMENT_START

std::string_view gamp::graph::gl::GraphRenderer::GLSL_PARAM_COMMENT_START = "\n// Gamp Graph Parameter Start\n"
staticconstexpr

Definition at line 96 of file GraphRenderer.hpp.

◆ GLSL_PARAM_COMMENT_END

std::string_view gamp::graph::gl::GraphRenderer::GLSL_PARAM_COMMENT_END = "// Gamp Graph Parameter End\n\n"
staticconstexpr

Definition at line 97 of file GraphRenderer.hpp.

◆ GLSL_USE_COLOR_CHANNEL

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_COLOR_CHANNEL = "#define USE_COLOR_CHANNEL 1\n"
staticconstexpr

Definition at line 98 of file GraphRenderer.hpp.

◆ GLSL_USE_NORMAL_CHANNEL

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_NORMAL_CHANNEL = "#define USE_NORMAL_CHANNEL 1\n"
staticconstexpr

Definition at line 99 of file GraphRenderer.hpp.

◆ GLSL_USE_LIGHT0

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_LIGHT0 = "#define USE_LIGHT0 1\n"
staticconstexpr

Definition at line 100 of file GraphRenderer.hpp.

◆ GLSL_USE_COLOR_TEXTURE

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_COLOR_TEXTURE = "#define USE_COLOR_TEXTURE 1\n"
staticconstexpr

Definition at line 101 of file GraphRenderer.hpp.

◆ GLSL_USE_FRUSTUM_CLIPPING

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_FRUSTUM_CLIPPING = "#define USE_FRUSTUM_CLIPPING 1\n"
staticconstexpr

Definition at line 102 of file GraphRenderer.hpp.

◆ GLSL_DEF_SAMPLE_COUNT

std::string_view gamp::graph::gl::GraphRenderer::GLSL_DEF_SAMPLE_COUNT = "#define SAMPLE_COUNT "
staticconstexpr

Definition at line 103 of file GraphRenderer.hpp.

◆ GLSL_CONST_SAMPLE_COUNT

std::string_view gamp::graph::gl::GraphRenderer::GLSL_CONST_SAMPLE_COUNT = "const float sample_count = "
staticconstexpr

Definition at line 104 of file GraphRenderer.hpp.

◆ GLSL_MAIN_BEGIN

std::string_view gamp::graph::gl::GraphRenderer::GLSL_MAIN_BEGIN = "void main (void)\n{\n"
staticconstexpr

Definition at line 105 of file GraphRenderer.hpp.

◆ gcuTexture2D

std::string_view gamp::graph::gl::GraphRenderer::gcuTexture2D = "gcuTexture2D"
staticconstexpr

Definition at line 106 of file GraphRenderer.hpp.

◆ colTexLookupFuncName

std::string_view gamp::graph::gl::GraphRenderer::colTexLookupFuncName = "texture2D"
staticconstexpr

Definition at line 107 of file GraphRenderer.hpp.

◆ GLSL_USE_DISCARD

std::string_view gamp::graph::gl::GraphRenderer::GLSL_USE_DISCARD = "#define USE_DISCARD 1\n"
staticconstexpr

Definition at line 108 of file GraphRenderer.hpp.

◆ shader_basename

std::string_view gamp::graph::gl::GraphRenderer::shader_basename = "curverenderer01"
staticconstexpr

Definition at line 109 of file GraphRenderer.hpp.

◆ source_dir

std::string_view gamp::graph::gl::GraphRenderer::source_dir = "impl/graph/glsl"
staticconstexpr

Definition at line 110 of file GraphRenderer.hpp.

◆ bin_dir

std::string_view gamp::graph::gl::GraphRenderer::bin_dir = "impl/graph/glsl/bin"
staticconstexpr

Definition at line 111 of file GraphRenderer.hpp.


The documentation for this class was generated from the following files: