![]() |
An open-source, flexible 3D physical simulation framework
|
Implementation (not much more than a wrapper) of the IShaderProvider for use with the old YamlShader files. More...
#include <YamlSP.h>
Public Member Functions | |
YamlSP (string res_path) | |
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 std::set< GLSLConstant > & | getConstants () const |
Returns the set of constants created by this shader. More... | |
const std::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... | |
void | addShaderFunction (ShaderFunc *func) |
Adds a shader function to this Provider or merges it with an existing one if present. More... | |
void | setupShaderEnv (ShaderType shader_type, ConfigMap material, bool has_texture, bool use_world_tex_coords) |
Sets up uniforms, exports, etc in code needed by the Yaml Shader Files. More... | |
![]() | |
IShaderProvider (string res_path) | |
Private Attributes | |
unique_ptr< ShaderFunc > | function |
Pointer to the shader function containing all necessary information to generate the shader code. More... | |
Additional Inherited Members | |
![]() | |
string | resPath |
The resource path for accessing definition files. More... | |
Implementation (not much more than a wrapper) of the IShaderProvider for use with the old YamlShader files.
Intended only for demonstration and not recommended for productive use anymore. (The shader functions still have to be created manually by code or YamlShader instances)
osg_material_manager::YamlSP::YamlSP | ( | string | res_path | ) |
Definition at line 26 of file YamlSP.cpp.
void osg_material_manager::YamlSP::addShaderFunction | ( | ShaderFunc * | func | ) |
Adds a shader function to this Provider or merges it with an existing one if present.
This function takes ownership of the given pointer and manages its memory.
func | The function to add/merge to this provider |
Definition at line 134 of file YamlSP.cpp.
|
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 108 of file YamlSP.cpp.
|
virtual |
Generates the main function of this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 64 of file YamlSP.cpp.
|
virtual |
Returns the set of attributes needed by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 57 of file YamlSP.cpp.
|
virtual |
Returns the set of constants created by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 50 of file YamlSP.cpp.
|
virtual |
Returns this shaders dependencies.
Implements osg_material_manager::IShaderProvider.
Definition at line 130 of file YamlSP.cpp.
|
virtual |
Returns the set of extensions disabled by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 123 of file YamlSP.cpp.
|
virtual |
Returns the set of extensions enabled by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 115 of file YamlSP.cpp.
|
virtual |
Returns the minimal glsl version needed for the generated shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 29 of file YamlSP.cpp.
|
virtual |
Returns the set of uniforms needed by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 36 of file YamlSP.cpp.
|
virtual |
Returns the set of varyings needed/created by this shader.
Implements osg_material_manager::IShaderProvider.
Definition at line 43 of file YamlSP.cpp.
void osg_material_manager::YamlSP::setupShaderEnv | ( | ShaderType | shader_type, |
ConfigMap | material, | ||
bool | has_texture, | ||
bool | use_world_tex_coords | ||
) |
Sets up uniforms, exports, etc in code needed by the Yaml Shader Files.
shader_type | The Shader Type this YamlSP is the provider for |
material | The entire material ConfigMap |
has_texture | Bool determining if a texture is used in the shader or not |
use_world_tex_coords | Determines if to use global texture coordinates or not |
Definition at line 143 of file YamlSP.cpp.
|
private |