Frequently Asked Questions

What is UUSL?

The Unified UNIGINE shader language (UUSL) is a wrapper, which unifies the most part of GLSL and HLSL syntax. You can use the UUSL instructions to write shader code without graphic API defining: it will work on both APIs.

Should I write shaders by using UUSL only?

Definitely not. UUSL is just a wrapper which facilitates the shader-writing process. You can also use an old-school approach by writing separately part of the shader for corresponding graphic API with GLSL and HLSL shading languages.

How are materials and shaders interrelated?

Material specifies which shaders for defined rendering pass it will use to render. You can define vertex, geometry and fragment shaders for a material. When you assign the material, the engine starts using its shaders to render the image. A piece of cake!

Do shaders need the compilation?

Yes, they do. But the engine does the job: just use the shaders_reload console command if you made some changes in shader files. It is really handy: you don't need to compile the shader every time you made any changes, you see the result of the changes in runtime without engine restart!

Notice

If you made changes in the material .mat file, you should reload the engine.

Can I debug the UUSL shader code?

The message contains information about which file has errors and their description (including the number of line).

Export the shader file to the file and find this code line to figure out what's happen. Shader will be exported in a file with the graphic API shader format (.hlsl or .glsl) located relatively to the data folder.

How to create custom shader for deferred/forward/post-process pass?

You can use tutorials on the corresponding theme to know how to create materials and shaders for them: