A plugin for setting shaders to a visual and its params. More...
#include <ShaderParam.hh>
Public Member Functions | |
ShaderParam () | |
Constructor. More... | |
~ShaderParam () override | |
Destructor. More... | |
void | Configure (const Entity &_entity, const std::shared_ptr< const sdf::Element > &_sdf, EntityComponentManager &_ecm, EventManager &_eventMgr) final |
Configure the system. More... | |
void | PreUpdate (const ignition::gazebo::UpdateInfo &_info, ignition::gazebo::EntityComponentManager &_ecm) override |
Documentation inherited. More... | |
Public Member Functions inherited from System | |
System ()=default | |
Constructor. More... | |
virtual | ~System ()=default |
Destructor. More... | |
Detailed Description
A plugin for setting shaders to a visual and its params.
Plugin parameters:
<shader> Shader to use - can be repeated to specify shader programs written in different languages. Attributes: language - Shader language. Possible values: glsl, metal Default to glsl if not specified <vertex> Path to vertex program <fragment> Path to fragment program Shader parameter - can be repeated within plugin SDF element <name> Name of uniform variable bound to the shader <shader> Type of shader, i.e. vertex, fragment <type> Variable type: float, int, float_array, int_array
Value to set the shader parameter to. The vallue string can be an int, float, or a space delimited array of ints or floats. It can also be 'TIME', in which case the value will be bound to sim time.
Example usage:
/// <plugin filename="ignition-gazebo-shader-param-system" /// name="ignition::gazebo::systems::ShaderParam"> /// <shader language='glsl'> /// <vertex>materials/my_vs.glsl</vertex> /// <fragment>materials/my_fs.glsl</fragment> /// </shader> /// <!-- Sets a fragment shader variable named "ambient" to red --> /// <param> /// <name>ambient</name> /// <shader>fragment</shader> /// <type>float_array</type> /// <value>1.0 0.0 0.0 1.0</value> /// </param> /// </plugin> ///
Constructor & Destructor Documentation
◆ ShaderParam()
ShaderParam | ( | ) |
Constructor.
◆ ~ShaderParam()
|
override |
Destructor.
Member Function Documentation
◆ Configure()
|
finalvirtual |
Configure the system.
- Parameters
-
[in] _entity The entity this plugin is attached to. [in] _sdf The SDF Element associated with this system plugin. [in] _ecm The EntityComponentManager of the given simulation instance. [in] _eventMgr The EventManager of the given simulation instance.
Implements ISystemConfigure.
◆ PreUpdate()
|
overridevirtual |
Documentation inherited.
Implements ISystemPreUpdate.
The documentation for this class was generated from the following file: