75fef8f5600197864d5f38328ccab4bef78627a3
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / shader-intro.h
1 /*! \page shader-intro Shader Effects
2  *
3
4 <h2 class="pg">Introduction</h2>
5
6 The shader effects allow the developer to apply visual deformations on the actors.
7 They can affect the geometry, the colors and textures of the actor.
8
9
10 <br>
11 <br>
12 <h2 class="pg">Custom Shader Effects</h2>
13 The \ref Dali::ShaderEffect "ShaderEffect" lets the developers create their own shader effects by specifying the vertex and pixel shaders.
14
15 A custom shader effect can be created like this:
16 @code
17 String myVertexShader; // This variable would contain the code for a vertex shader.
18 Dali::ShaderEffect myEffect = Dali::ShaderEffect::New( myVertexShader,
19                                                        "" // use default pixel shader
20                                                      );
21 @endcode
22
23 The value of a uniform can be set like this:
24 @code
25 // if the uniform was declared like this in the shader: uniform float myUniform;
26 myEffect.SetUniform( "myUniform", 0.5f );
27 @endcode
28
29 The custom shader effect can be applied to an actor like any other shader:
30 @code
31 actor.SetShaderEffect( myEffect );
32 @endcode
33
34  *
35  */