You copied the Doc URL to your clipboard.

3.3. Importing existing Shader effects and configurations

To create a new Generic Project in Eclipse and import the example shader content from the Mali Shader Library into this project:

  1. Install the Offline Shader Compiler and Shader Library as described in Mali Developer Tools.

  2. Select File → New → Project ...

    The New Project dialog box is displayed.

  3. Select General → Project.

  4. Click Next.

    The New Project dialog box is displayed.

  5. Enter a name for the project. For example, ExampleContent.

    Note

    The project is set to Create a new project from workspace. To avoid a known issue documented in the Mali GPU Shader Development Studio Errata, ARM recommends you choose the option Create project from existing source while creating new eclipse java project for the shader sources. Only the Create project from existing source is described.

  6. Copy the ShaderExamples folder to your work area, it is located at:

    C:\Program Files\ARM\Mali Developer Tools\Mali GPU Shader Library vm.n

    In this example the location for the work area is:

    C:\Mali Developer Tools Work Area\

    Note

    This is done to prevent any data corruption occurring in the original folder.

  7. Right-click the newly created project and select Import.

  8. The shader configuration files in the Mali GPU Shader Library not compatible with the Shader Development Studio version 1.3. Use the new configuration files that are in the Shader Development Studio Examples folder:

    Copy the Examples\ShaderExamples\shader.shaderconfig file from the Shader Development Studio installation directory to the ShaderExamples folder in your work area.

    Note

    Copying the new configuration files overwrites the existing files.

  9. Select General → File System.

  10. Click Next.

  11. Select Browse ... and navigate to the ShaderExamples folder in your work area.

  12. Click OK.

  13. Click Select All.

  14. Click Finish.

  15. The new project is created in the Package Explorer pane of the Shader Development Studio.

    The selected files are imported into the project. See Figure 3.19:

    Figure 3.19. Example content in project

    Example content in project

    Note

    The steps to create a new Eclipse project for OrangeBookExamples, also present in Mali Shader, are similar.

    The example content available in the Shader Library contains some more advanced shaders that implement the complex graphics effects that were missing from the example shader effect used in previous sections.

    A pre-built shader configuration file is supplied with the example content that contains pre-made shader effects, so you do not have to create a shader configuration manually. Instead, the shader effects can be rendered immediately.

  16. In the Shader Control view, click the Select Shader to Render icon and select ExampleContent  → Demo 04 - Lighting.

    The torus is re-rendered in the Shader Preview view, but this time lighting calculations are applied. The torus is now three-dimensional. See Figure 3.20:

    Figure 3.20. Demo - 04 - Lighting effect

    Demo - 04 - Lighting effect

    Try changing the preview model in the Shader Control view to see the effects that are produced by the other geometry models provided in the example content.

Was this page helpful? Yes No