Changes between Version 1 and Version 2 of guide:using the Pipeline
- Timestamp:
- 12/22/08 18:03:08 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
guide:using the Pipeline
v1 v2 38 38 The shaders are compiled on demand, this means there is not only one shader in memory per pipeline, instead of that, they are compiled according to the set of macros needed and stored for further use. This way to handle the shaders have a significant overhead in the performance, that's because the programmer has the posibility to give an identifier to the input, using an id we can store precompiled shaders and retrieve them according to that id. Using the id we skip all the defining steps. 39 39 40 {{{#!cplusplus 40 {{{ 41 #!cpp 41 42 <shader vs="data/shaders/global.vsh" ps="data/shaders/global.psh"> 42 43 <define name="USE_NORMALS"/> … … 75 76 76 77 Example of condition embedded in a regular action: 77 {{{#!cplusplus 78 {{{ 79 #!cpp 78 80 <buffer name="normal" if_input="normal"/> 79 81 }}} … … 89 91 90 92 Example of conditional action: 91 {{{#!cplusplus 93 {{{ 94 #!cpp 92 95 <condition if_shader="USE_LIGHT"> 93 96 <constant name="ambient_color" type="vector3" value="0,0,0" /> … … 127 130 128 131 To fill our parameter container we just call the 'add' method: 129 {{{#!cplusplus 132 {{{ 133 #!cpp 130 134 ParameterContainer* container = new ParameterContainer; 131 135 container->add("camera", mycamera); //allows to get camera info from the pipeline … … 137 141 == How to execute the pipeline == 138 142 Once the ParameterContainer is full with all our data we give it to the Pipeline and call for execute: 139 {{{#!cplusplus 143 {{{ 144 #!cpp 140 145 pipeline->setContainer( container ); 141 146 pipeline->execute();
