top of page

The shaders that work in our engine are with GLSL language.

To implement the Shader pipeline in our engine we had to add two more resources. These two new resources are Shader Object and Shader Program Material.

The resource Shader Object is the GLSL code that you can import in the Engine and with two of this resource you can make a Shader Program.

Before trying to link two shader object into a shader program every Shader Object is compiled and if the compilation failed because the shader code isn’t correct in the console will be printed an error telling you where you can find the error line.

Inside the Engine you can go GameObject>Create Shader there you can put the name of the File and the type: Vertex or Fragment.

In the shader object you can add variables “in” and “out” that will be communicating between the two shaders object sending information. You can also add uniform variables that will be able to receive information from the engine, but if you want to receive this information you will have to edit the source code.

This resource like the others can be modified in runtime and this specially because inside the engine we have created an editor where you can edit the Shader Object without having to close the Engine.

The resource of Shader Program is created as we told before, linking two Shader Object. Inside the Engine you can go to GameObject>Link new Program Shader then choose two among all the shaders that the Resource manager have and add a name to this program.

If you try to link a program that has shaders not compiled the program will not work.

Lastly, we have a Shader Manager that his job is to send global information for all the shader objects and if you want to use this information you can.

Shaders 

pipeline

  • Explanation

To create a new shader go to Menu-> Create New shader. Add a name and a type, and click create! The built in editor will show, where you can edit your shader. Remember to write the glsl version you're working on!

To link two shaders into a shader program just go to Menu->Link Shader Program. Choose a name and both shaders and now the Shader program is ready to use!

To choose between Shader Programs double click an object on the World Window, or double click it in the scene Window.

In the Inspector bar, click shader type and choose the shader you want to use.

If any of the 3 Water Shaders is chosen you can change 3 colors. Albedo, Light, and Specular Light.

With the default shader, you can also change the texture, by adding a new material.

With the Water shader, press play to see the waves moving. In the Application window you can change the dt to speed up or slowdown the waves.

bottom of page