diff --git a/docs/html/guide/topics/renderscript/graphics.jd b/docs/html/guide/topics/renderscript/graphics.jd index 3ea3f85841ddd..2fefecc172ecf 100644 --- a/docs/html/guide/topics/renderscript/graphics.jd +++ b/docs/html/guide/topics/renderscript/graphics.jd @@ -9,10 +9,26 @@ parent.link=index.html
  1. - Developing a RenderScript application - + Creating a Graphics Renderscript
      -
    1. The Hello Graphics application
    2. +
    3. Creating the native Renderscript file
    4. +
    5. Creating the Renderscript entry point class
    6. +
    7. Creating the surface view
    8. +
    9. Creating the activity
    10. +
    +
  2. +
  3. + Drawing +
      +
    1. Drawing using the rsgDraw functions
    2. +
    3. Drawing with a mesh
    4. +
    +
  4. +
  5. + Shaders +
      +
    1. Shader bindings
    2. +
    3. Defining a sampler
@@ -40,7 +56,7 @@ href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samp will need to be familiar with APIs to appropriately render 3D graphics on an Android-powered device.

-

Creating a Graphics RenderScript

+

Creating a Graphics RenderScript

Because of the various layers of code when writing a RenderScript application, it is useful to create the following files for a scene that you want to render:

@@ -73,7 +89,7 @@ href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samp RenderScript sample that is provided in the SDK as a guide (some code has been modified from its original form for simplicity).

-

Creating the native RenderScript file

+

Creating the native RenderScript file

Your native RenderScript code resides in a .rs file in the <project_root>/src/ directory. You can also define .rsh header @@ -102,8 +118,8 @@ href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samp enough or more resources to do so, and renders as fast as it can if it does not.

For more - information on using the RenderScript graphics functions, see Using the Graphics APIs.

+ information on using the RenderScript graphics functions, see the Drawing section.

  • An init() function. This allows you to do any initialization of your @@ -153,7 +169,7 @@ int root(int launchID) { } -

    Creating the RenderScript entry point class

    +

    Creating the RenderScript entry point class

    When you create a RenderScript (.rs) file, it is helpful to create a corresponding Android framework class that is an entry point into the .rs file. In @@ -218,7 +234,7 @@ public class HelloWorldRS { -

    Creating the surface view

    +

    Creating the surface view

    To create a surface view to render graphics on, create a class that extends {@link android.renderscript.RSSurfaceView}. This class also creates a RenderScript context object @@ -293,7 +309,7 @@ public class HelloWorldView extends RSSurfaceView { -

    Creating the Activity

    +

    Creating the Activity

    Applications that use RenderScript still adhere to activity lifecyle, and are part of the same view hierarchy as traditional Android applications, which is handled by the Android VM. This @@ -329,9 +345,9 @@ public class HelloWorldActivity extends Activity { } -

    Drawing

    - -

    Drawing using the rsgDraw functions

    +

    Drawing

    +

    The following sections describe how to use the graphics functions to draw with Renderscript.

    +

    Drawing using the rsgDraw functions

    The native RenderScript APIs provide a few convenient functions to easily draw a polygon to the screen. You call these in your root() function to have them render to the @@ -348,7 +364,7 @@ public class HelloWorldActivity extends Activity { the screen.

  • -

    Drawing with a mesh

    +

    Drawing with a mesh

    When you want to draw complex shapes and textures to the screen, instantiate a {@link android.renderscript.Mesh} and draw it to the screen with rsgDrawMesh(). A {@link @@ -559,7 +575,7 @@ return 0; //specify a non zero, positive integer to specify the frame refresh. "{@docRoot}resources/samples/RenderScript/MiscSamples/src/com/example/android/rs/miscsamples/RsRenderStatesRS.html"> RsRenderStatesRS sample has many examples on how to create a shader without writing GLSL.

    -

    Shader bindings

    +

    Shader bindings

    You can also set four pragmas that control the shaders' default bindings to the {@link android.renderscript.RenderScriptGL} context when the script is executing:

    @@ -599,7 +615,7 @@ return 0; //specify a non zero, positive integer to specify the frame refresh. #pragma stateStore(parent) -

    Defining a sampler

    +

    Defining a sampler

    A {@link android.renderscript.Sampler} object defines how data is extracted from textures. Samplers are bound to Program objects (currently only a Fragment Program) alongside the texture