Original: Write HLSL shader using custom node in Unreal.
Current: Learn more about basic concepts and get familiar with composing shaders with Unreal’s Material Network.
Final Result Explanation:
I followed the tutorial in the Unreal Documentation as the start point of getting familiar with Unreal Shaders.
The two tutorials:
The Cel Shading breaks down the lights into series of bands during post processing. The water shader get the time and move the normal to create animation on the water surface.
Switch the plan half-way
I changed my plan in the middle of the week. At first, I was thinking of writing an HLSL shader in Unreal. However, it is not good as a first step:
- You need to monitor the performance by yourself since Unreal doesn’t do code optimization on Custom Node, so use some profiler to help you.
- It is hard to debug
It is recommended that you create shaders with Unreal’s Material Editor. You can make most of the shaders by using Unreal’s material expressions.
The tutorial I watched part of was: https://www.youtube.com/watch?v=HaUAfgrZjlU
For future use here’s a microsoft’s tutorial of debugging a shader: https://msdn.microsoft.com/en-us/library/dn217886.aspx
Review PBR & Linear Workflow
Here’s a great explanation about the science behind PBR.
And here’s another tutorial about why we have to use Linear Workflow from Nvidia
Something to Keep in mind:
- by convention, all JPEG files are precorrected for a gamma of 2.2.
- for Substance Painter: all maps are to be interpreted as linear except for base color, diffuse and specular.
- Do the gamma correction as the last step of the last post-processing pass