User Tools

Site Tools


en:orx:config:settings_structure:orxshader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:orx:config:settings_structure:orxshader [2018/02/14 00:46 (6 years ago)] – external edit 127.0.0.1en:orx:config:settings_structure:orxshader [2023/09/20 00:22 (7 months ago)] (current) sausage
Line 11: Line 11:
    // Do stuff    // Do stuff
   }"   }"
-KeepInCache    <bool> +CodeList       CodeKey1 # ... # CodeKeyN  
-ParamList      = ParamFloat ParamTexture ParamVector+ParamList      = Param1 ... ParamN
 ParamFloat     = <float> ParamFloat     = <float>
 ParamVector    = <vector> ParamVector    = <vector>
-ParamTexture   = path/to/TextureFile|screen +ParamTexture   = path/to/texture 
-UseCustomParam = <bool></code>+UseCustomParam = <bool> 
 +KeepInCache    = <bool> 
 +</code>
  
  
Line 22: Line 24:
  
 Here's a list of the available properties for an ''orxSHADER'' structure: Here's a list of the available properties for an ''orxSHADER'' structure:
-  * ''Code'': This block ((delimited by double quotes (") as seen in the [[en:orx:config:syntax|syntax page]])) contains the code that will be executed. It needs to be provided and be valid [[wp>glsl|GLSL]] fragment shader code.+  * ''Code'': Used to declare a monolithic shader. Will be ignored if CodeList is defined. This block ((delimited by double quotes (") as seen in the [[en:orx:config:syntax|syntax page]])) contains the code that will be executed. It needs to be provided and be valid [[wp>glsl|GLSL]] fragment shader code
 +  * ''CodeList'': The values of this list will be used as config keys from this section to reconstruct, in the given order, a multi-part shader. If not defined, Code will be used instead.
   * ''KeepInCache'': Defines if the shader code should be kept in memory even if no shader of this type is currently in use. This saves time (reading from disk + compiling) but costs memory. Its default value is ''false''.   * ''KeepInCache'': Defines if the shader code should be kept in memory even if no shader of this type is currently in use. This saves time (reading from disk + compiling) but costs memory. Its default value is ''false''.
-  * ParamList: This defines the list of parameters needed and used by the shader'code. Every defined parameter must have a default value that will help orx guess their type. If none is provided, then its type will be assumed to be a texture. Available types are <float>, <vector> and texture (if a path to a texture file or the keyword ''screen'' is provided). If an invalid path is provided for a parameter, or the parameter isn't defined at all, the owner's texture will be used ((if the owner is a viewport, it will be its associated texture; if it's an object, it's current graphic/animation key's texture will be used)). **If an explicit list is provided for any parameter, the shader variable will be an array of this parameter type (instead of a regular variable) and its size will be the number of items in the list.** +  * ParamList: Define all the parameters your shader code needsDefined params then must have a default value to guess their type: textures, vectors and floats are supported. If none is provided, type defaults to texture and will use shader's owner texture as value. If an invalid path is provided for a parameter, or the parameter isn't defined at all, the owner's texture will be used ((if the owner is a viewport, it will be its associated texture; if it's an object, it's current graphic/animation key's texture will be used)). **If an explicit list is provided for any parameter, the shader variable will be an array of this parameter type (instead of a regular variable) and its size will be the number of items in the list.** 
-  * ''UseCustomParam'': Defines if parameters can have their value overridden at runtime (ie. interactive). Its default value is ''false'' which means only the default values will be used.+  * ''UseCustomParam'': When set to true, an event will be sent to override params values at runtime as well as the automated "time" value. Defaults to false, ie. no runtime override unless "time" is used for a float param.
  
-Here's a simple example of a non-interactive shader as seen in the [[en:tutorials:spawner|spawner/shader tutorial]].+Here's a simple example of a non-interactive shader as seen in the [[en:tutorials:spawners:spawner|spawner/shader tutorial]].
  
 <code ini>[Decompose] <code ini>[Decompose]
Line 66: Line 69:
 offset    = (-0.05, -0.05, 0.0) ~ (0.05, 0.05, 0.0); <= Let's take some random offset</code> offset    = (-0.05, -0.05, 0.0) ~ (0.05, 0.05, 0.0); <= Let's take some random offset</code>
  
-Please see the [[en:tutorials:spawner|spawner/shader tutorial]] for more information.+Please see the [[en:tutorials:main#spawners|Shader Tutorials]] and [[en:examples:shaders:main|Shader Examples]] for more information.
  
 === Overriding Parameters at Runtime with UseCustomParam === === Overriding Parameters at Runtime with UseCustomParam ===
en/orx/config/settings_structure/orxshader.1518597998.txt.gz · Last modified: 2018/02/14 00:46 (6 years ago) by 127.0.0.1