Changes between Version 1 and Version 2 of guide:using the Pipeline

Show
Ignore:
Timestamp:
12/22/08 18:03:08 (4 years ago)
Author:
javi.agenjo (IP: 193.145.45.22)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • guide:using the Pipeline

    v1 v2  
    3838The 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. 
    3939 
    40 {{{#!cplusplus 
     40{{{ 
     41#!cpp 
    4142<shader vs="data/shaders/global.vsh" ps="data/shaders/global.psh"> 
    4243        <define name="USE_NORMALS"/> 
     
    7576 
    7677Example of condition embedded in a regular action: 
    77 {{{#!cplusplus 
     78{{{ 
     79#!cpp 
    7880<buffer name="normal" if_input="normal"/> 
    7981}}} 
     
    8991 
    9092Example of conditional action: 
    91 {{{#!cplusplus 
     93{{{ 
     94#!cpp 
    9295<condition if_shader="USE_LIGHT"> 
    9396        <constant name="ambient_color" type="vector3" value="0,0,0" /> 
     
    127130 
    128131To fill our parameter container we just call the 'add' method: 
    129 {{{#!cplusplus 
     132{{{ 
     133#!cpp 
    130134ParameterContainer* container = new ParameterContainer; 
    131135container->add("camera", mycamera); //allows to get camera info from the pipeline 
     
    137141== How to execute the pipeline == 
    138142Once the ParameterContainer is full with all our data we give it to the Pipeline and call for execute: 
    139 {{{#!cplusplus 
     143{{{ 
     144#!cpp 
    140145        pipeline->setContainer( container ); 
    141146        pipeline->execute();