How To Use

EllieAnsell edited this page May 8, 2016 · 28 revisions


Navigating the viewport.
The viewport manipulation is similar to most 3D software packages. Using the left mouse button you can rotate the viewport; moving the right mouse button allows you to pan and you can zoom in and out by scrolling the mouse wheel. If you accidentally lose focus of the object, hit 'F' or click 'reset' in camera settings to revert to the default view. In the 'settings' tab, camera controls include roll, yaw, pitch, a slider to set the FOV and the option to change the clipping plane distance. The camera's orthographic view can be set and reset, too. Below the camera settings are visibility switches which can be toggled to show the axis, grid, wireframe ('w') and normals ('n'), and the slider will adjust their size. Below these are the options to export and print uniforms to be saved.

The default view window.

  1. Writing your first shader
    Upon opening the project, you can either choose to load fragment and vertex shaders via the shader wizard window or simply press 'Esc' to skip to playing with CEB.
    The default shader in CEB is a normal material which softly reflects light. To begin, load the preset shaders included in the project for both the vertex and fragment shaders:
    File-> Import Shaders -> Import Vertex Shader / Import Fragment Shader
    (Or Ctrl+Shift+v / Ctrl+Shift+v)

The library includes plastic, metal and toon shading as well as a shader with texture mapping support. Compiling any of these shaders will prompt the Uniform buttons to appear. From here you can affect parameters such as ambient, colour, light position to visualise the shader applied.

The default window and with normal material.

Use the central buttons (colour, light.ambient, light.constantAttenuation etc.) to change how the object looks. You can edit the shader files directly via the vertex and fragment text editors, then clicking 'compile shader' to see the results. Auto-correct is incorporated into the editor, as well as syntax highlighting. Errors are thrown to the error log in the compiler.

Default shape dragon with high material shininess and a metal shader.

  1. Loading in custom .OBJ files
    CEB already contains a selection of .obj files and primitive shapes to start, but you can also load in your own files provided they're triangulated beforehand.
    Load Shapes -> Import OBJ

Importing a custom obj file

  1. Applying texture maps
    To load texture maps, first import the TextureMapVertex and TextureMapFragment shaders. Then go:
    Load Texture -> Load Texture...
    (Ctrl + T) Loading in custom texture maps for diffuse values are supported in CEB. Some example texture maps are included in the project, however you are free to use custom maps.
    Note: the shader needs to support texture maps to work.

Texture map example.

  1. Loading in custom .glsl files
    CEB also supports loading in custom GLSL files directly in the IDE. (Note that this will overwrite any text currently in the editor.) Using this you can load in any presets provided or your own. By going File>Import Shaders you can choose either Fragment or Vertex.

  2. Saving and loading files
    CEB supports saving and loading the shader project files in .xml format. Saving and loading are both accessed via the "File" tab:
    File -> save project as...

File -> Open project...

Loading a saved project file.

  1. Using the Project Wizard
    Using the Project Wizard is designed to help the user to create shaders. By setting a new project the user can specify their desired version of GLSL, profile, project name as well as associated vertex and fragment shaders. The project wizard upon opening Choosing the name of your project Loading the phong vertex/ fragment shaders

  2. Exporting Shader Uniforms
    If you find particular uniform set-ups that work well and you would like to re-use in other projects or shaders, you have the ability to export them for later use. These are saved out as text files and can also be run in the Terminal to confirm the exporting. Exporting the uniforms Exported the uniforms successfully.

The pop-up reads "Uniform data successfully exported!", and a text editor shows the written data saved as a .txt file to be used in other applications.