X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Fdali-script-v8%2Fdocs%2Fcontent%2Fshader-effect.js;h=98e9c17f5ed8acd845eb2191b6c6604721b304af;hb=refs%2Fchanges%2F36%2F36536%2F6;hp=ea1eba83599e65b1c9bce2713ccd146e225283f0;hpb=5d49d819924da76f96f22845210abe89a7ade187;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/plugins/dali-script-v8/docs/content/shader-effect.js b/plugins/dali-script-v8/docs/content/shader-effect.js index ea1eba8..98e9c17 100644 --- a/plugins/dali-script-v8/docs/content/shader-effect.js +++ b/plugins/dali-script-v8/docs/content/shader-effect.js @@ -5,7 +5,13 @@ Shader effects provide a visual effect for actors. -For a Custom shader you can provide the vertex and fragment shader code as strings. +You can create a type-registered shader effect by its type name. +``` +// create a new shader effect +var shader = new dali.ShaderEffect("BlindEffect"); +``` + +Alternatively you can create a Custom shader by providing the vertex and fragment shader code as strings. Each shader is provided with default uniforms and attributes. For a vertex shader this part contains the following code: ``` @@ -168,7 +174,7 @@ var animOptions = { // if we go to 1.0 then it will go to a full box shaderAnim.animateTo( revealEffect, "uRadius", 0.5,animOptions); shaderAnim.play(); - +``` * * * ### Example of paper twisting in the wind with color (Vertex + Fragment Shader) @@ -185,7 +191,7 @@ vertices. To do this we can break the image into a grid using the gridX and grid - +``` createTwistEffect = function() { @@ -238,7 +244,7 @@ imageActor.setCullFace( dali.CULL_FACE_DISABLE ); // disable face culling so we dali.stage.add( imageActor ); // start it of tilted around the y-axis -imageActor.rotation=new dali.Rotation(90, 0, 1, 0); +imageActor.orientation=new dali.Rotation(90, 0, 1, 0); var twistEffect = createTwistEffect(); imageActor.setShaderEffect( twistEffect );