Accessing Sample Files

You need the following Scenome® modules to complete this exercise: Scenome® Platform Binaries

In this exercise you'll learn how to access shader samples. There are two groups of samples: reference shaders and library shaders. You can alway access library shaders by starting the Shader application and selecting File » Open from the main menu. Then you can simply select the directory containing the shader you wish to open.

The GLSL reference library is very large, containing around 5000 sample shaders designed to provide working samples that render nearly every OpenGL pixel format and topology in all GLSL versions that support them. The Shader application includes a feature that makes it pretty easy to explore the GLSL reference library and find exactly what you're looking for. Of course you can just as quickly determine that something isn't supported by our shader reference library and send us a request.

Start The Shader Application

  1. Start the Shader app. (Start » Programs » Scenomics » Shader) or (Windows® key and then type 'Shader' to find the app icon.)

    The application displays a splash screen and then the application desktop appears.

    This is a picture of the desktop.

Access GLSL Reference Library Samples

  1. Examine the main menu and select File » Open From GLSL Reference Library....

    The software presents a dialog that allows you to choose the pixel format and topology of the GLSL reference shader you wish to locate. The third option allows you to open the reference document in the application or to open an Explorer® window to the location of the GLSL reference shader.

    This is a picture of the reference shader selector dialog.
  2. Set Select OpenGL Pixel Format to F32 RGBA.
  3. Set Select OpenGL Toplogy to Cubemap Array.
  4. Set Select Explore Mode to I want to open the reference in this application..

    The software presents an Explorer® in the directory containing the desired GLSL reference shader.

    This is a picture of the file open dialog.

    Note that in this case we have two examples. We can choose imageCubeArray.box or samplerCubeArray.box. These documents provide examples of the texture being bound as a standard sampler (samplerCubeArray) that is read only and an image sampler (imageCubeArray) that you can read or write.

  5. Select imageCubeArray.box and click Open or hit ENTER when you are finished.

    The software opens the GLSL reference document.

    This is a picture of the GLSL reference document.

    Let's see if this topology works with any versions of OpenGL ES.

Explore GLSL Reference Folder

  1. Select File » Open Containing Folder from the main menu.

    The software opens the file open dialog in the folder that contains the document.

    This is a picture of the folder that contains the GLSL reference document.

    Here we see a folder named 320. This is an OpenGL ES version so we know that this pixel format and topology are supported by OpenGL ES. We don't know if your GPU supports OpenGL 320 ES, but we're about to find out!

Change OpenGL Profile

  1. Return to the running Shader application.
  2. Examine the hierarchy and find the <Program> node named <Program>. This is a picture of the hierarchy.
  3. Right click over the <Program> node named <Program> and select Set OpenGL Profile... from the listed options.

    The software presents a dialog that allows you to choose the OpenGL profile and shaders used by the <Program> node.

    This is a picture of the select OpenGL profile dialog.
  4. If your GPU supports 320 es, then select 320 es from the listed options and click OK or hit ENTER when you are finished.

    (Select a different profile if your GPU does not support 320 es.)

    The application switches the shaders. If successful, you'll see information in the output window.

    --- <Executing Command 'ProgramSetProfileOpenGL'> ---
    
    Set new shader: .\320\imagecubearray\imagecubearray_fragment_shader.glsl
    Set new shader: .\320\imagecubearray\imagecubearray_vertex_shader.glsl
    
    Compiling Program 0x000002B69B9DC7D0 0x0000000000000000 <Program>