Accessing GLSL Reference Shader Library
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
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.
Access GLSL Reference Library Samples
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.
- Set Select OpenGL Pixel Format to F32 RGBA.
- Set Select OpenGL Toplogy to Cubemap Array.
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.
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.
Select imageCubeArray.box and click Open or hit ENTER when you are finished.
The software opens the GLSL reference document.
Let's see if this topology works with any versions of OpenGL ES.
Explore GLSL Reference Folder
Select File » Open Containing Folder from the main menu.
The software opens the file open dialog in the folder that contains the 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
- Return to the running Shader application.
- Examine the hierarchy and find the Program node named Program.
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.
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 0x2116AD48 0x00000000 <Program>
This exercise is complete. Return to tutorials.