Skip to content

Custom Shaders

tobspr edited this page Aug 15, 2014 · 16 revisions

The Pipeline uses Physically Based Shading. Your shaders have to output 4 constraints: metallic, roughness, specular, baseColor. You can find a very well explanation of them at the documentation of the UnrealEngine 4 here.

When you don't need any special features, you can just use the Default Shader, which you can get with renderPipeline.getDefaultObjectShader(). Your object should have the textures and materials applied like in Exporting from Blender. The pipeline also supports Tesselation.

Otherwise the pipeline already provides a bunch of functions which simplify the material handling. You can have a look at the default fragment shader DefaultShader.fragment, which should be pretty self explanatory. Your shader also has to set the position and normal in world space, also velocity, you can find a basic vertex shader here.

There is a material-editor planned to simplify the creation of new materials.

Clone this wiki locally