Privacy
An open-source, flexible 3D physical simulation framework
osg_material_manager::DRockGraphSP Class Reference

#include <DRockGraphSP.h>

Public Member Functions

 DRockGraphSP (string res_path, ConfigMap graph, ConfigMap options)
 
int getMinVersion ()
 Returns the minimal glsl version needed for the generated shader. More...
 
const set< GLSLUniform > & getUniforms () const
 Returns the set of uniforms needed by this shader. More...
 
const set< GLSLAttribute > & getVaryings () const
 Returns the set of varyings needed/created by this shader. More...
 
const set< string > & getEnabledExtensions () const
 Returns the set of extensions enabled by this shader. More...
 
const set< string > & getDisabledExtensions () const
 Returns the set of extensions disabled by this shader. More...
 
const vector< pair< string, string > > getDependencies () const
 Returns this shaders dependencies. More...
 
const set< GLSLConstant > & getConstants () const
 Returns the set of constants created by this shader. More...
 
const set< GLSLAttribute > & getAttributes () const
 Returns the set of attributes needed by this shader. More...
 
string generateMainSource ()
 Generates the main function of this shader. More...
 
string generateDefinitions ()
 Generates function definitions for this shader. More...
 
- Public Member Functions inherited from osg_material_manager::IShaderProvider
 IShaderProvider (string res_path)
 

Private Member Functions

void parseGraph ()
 Parses the graph file to fill the fields with the correct content. More...
 
void parse_functionInfo (string functionName, ConfigMap functionInfo)
 Parses a functionInfo and adds varyings, uniforms and function source code to the provider. More...
 

Private Attributes

ConfigMap model
 
ConfigMap options
 Containing options needed for shader generation. More...
 
string main_source
 Contains the shaders main function generated from the graph definition. More...
 
map< string, string > source_files
 Contains resource path to all source code needed by the main function. More...
 
int minVersion
 
set< GLSLUniformuniforms
 
set< GLSLAttributevaryings
 
set< string > enabledExtensions
 
set< string > disabledExtensions
 
vector< pair< string, string > > dependencies
 
set< GLSLConstantconstants
 
set< GLSLAttributeattributes
 

Additional Inherited Members

- Protected Attributes inherited from osg_material_manager::IShaderProvider
string resPath
 The resource path for accessing definition files. More...
 

Detailed Description

Definition at line 32 of file DRockGraphSP.h.

Constructor & Destructor Documentation

◆ DRockGraphSP()

osg_material_manager::DRockGraphSP::DRockGraphSP ( string  res_path,
ConfigMap  graph,
ConfigMap  options 
)

Definition at line 34 of file DRockGraphSP.cpp.

Member Function Documentation

◆ generateDefinitions()

string osg_material_manager::DRockGraphSP::generateDefinitions ( )
virtual

Generates function definitions for this shader.

Should also contain everything else outside of the main function that is not defining uniforms, varyings, extensions, constants or attributes.

Implements osg_material_manager::IShaderProvider.

Definition at line 77 of file DRockGraphSP.cpp.

◆ generateMainSource()

string osg_material_manager::DRockGraphSP::generateMainSource ( )
virtual

Generates the main function of this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 53 of file DRockGraphSP.cpp.

◆ getAttributes()

const std::set< GLSLAttribute > & osg_material_manager::DRockGraphSP::getAttributes ( ) const
virtual

Returns the set of attributes needed by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 69 of file DRockGraphSP.cpp.

◆ getConstants()

const std::set< GLSLConstant > & osg_material_manager::DRockGraphSP::getConstants ( ) const
virtual

Returns the set of constants created by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 65 of file DRockGraphSP.cpp.

◆ getDependencies()

const vector< pair< string, string > > osg_material_manager::DRockGraphSP::getDependencies ( ) const
virtual

Returns this shaders dependencies.

Implements osg_material_manager::IShaderProvider.

Definition at line 73 of file DRockGraphSP.cpp.

◆ getDisabledExtensions()

const set< string > & osg_material_manager::DRockGraphSP::getDisabledExtensions ( ) const
virtual

Returns the set of extensions disabled by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 61 of file DRockGraphSP.cpp.

◆ getEnabledExtensions()

const set< string > & osg_material_manager::DRockGraphSP::getEnabledExtensions ( ) const
virtual

Returns the set of extensions enabled by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 57 of file DRockGraphSP.cpp.

◆ getMinVersion()

int osg_material_manager::DRockGraphSP::getMinVersion ( )
virtual

Returns the minimal glsl version needed for the generated shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 41 of file DRockGraphSP.cpp.

◆ getUniforms()

const set< GLSLUniform > & osg_material_manager::DRockGraphSP::getUniforms ( ) const
virtual

Returns the set of uniforms needed by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 45 of file DRockGraphSP.cpp.

◆ getVaryings()

const set< GLSLAttribute > & osg_material_manager::DRockGraphSP::getVaryings ( ) const
virtual

Returns the set of varyings needed/created by this shader.

Implements osg_material_manager::IShaderProvider.

Definition at line 49 of file DRockGraphSP.cpp.

◆ parse_functionInfo()

void osg_material_manager::DRockGraphSP::parse_functionInfo ( string  functionName,
ConfigMap  functionInfo 
)
private

Parses a functionInfo and adds varyings, uniforms and function source code to the provider.

Definition at line 256 of file DRockGraphSP.cpp.

◆ parseGraph()

void osg_material_manager::DRockGraphSP::parseGraph ( )
private

Parses the graph file to fill the fields with the correct content.

Definition at line 90 of file DRockGraphSP.cpp.

Member Data Documentation

◆ attributes

set<GLSLAttribute> osg_material_manager::DRockGraphSP::attributes
private

Definition at line 82 of file DRockGraphSP.h.

◆ constants

set<GLSLConstant> osg_material_manager::DRockGraphSP::constants
private

Definition at line 81 of file DRockGraphSP.h.

◆ dependencies

vector<pair<string, string> > osg_material_manager::DRockGraphSP::dependencies
private

Definition at line 80 of file DRockGraphSP.h.

◆ disabledExtensions

set<string> osg_material_manager::DRockGraphSP::disabledExtensions
private

Definition at line 79 of file DRockGraphSP.h.

◆ enabledExtensions

set<string> osg_material_manager::DRockGraphSP::enabledExtensions
private

Definition at line 78 of file DRockGraphSP.h.

◆ main_source

string osg_material_manager::DRockGraphSP::main_source
private

Contains the shaders main function generated from the graph definition.

Definition at line 68 of file DRockGraphSP.h.

◆ minVersion

int osg_material_manager::DRockGraphSP::minVersion
private

Definition at line 75 of file DRockGraphSP.h.

◆ model

ConfigMap osg_material_manager::DRockGraphSP::model
private

Definition at line 57 of file DRockGraphSP.h.

◆ options

ConfigMap osg_material_manager::DRockGraphSP::options
private

Containing options needed for shader generation.

Fields: num_lights: needed

Definition at line 63 of file DRockGraphSP.h.

◆ source_files

map<string, string> osg_material_manager::DRockGraphSP::source_files
private

Contains resource path to all source code needed by the main function.

Definition at line 73 of file DRockGraphSP.h.

◆ uniforms

set<GLSLUniform> osg_material_manager::DRockGraphSP::uniforms
private

Definition at line 76 of file DRockGraphSP.h.

◆ varyings

set<GLSLAttribute> osg_material_manager::DRockGraphSP::varyings
private

Definition at line 77 of file DRockGraphSP.h.


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