Fresnel & Normal Maps
If you input a Normal Map into the Normal input of the Fresnel, you will see that you can affect the surface in a number of very interesting ways.
This is because of the Normal maps influence over the surface normal. As we learned before, the Fresnel works by checking to see if the surface normal is perpendicular to the camera or not.
If it is perpendicular to the camera, then the Fresnel effect will take place. On a smooth sphere, this means that the Fresnel will only take place at the edges of object.
However when a Normal map is introduced, we change the surface normal to no longer be smooth, allowing the Fresnel effect to take happen in places that it normally would not if the
surface Normal had been smooth.
For a visual example of what is going on, take a look at the following image showing the effect the surface normal has on the Fresnel.
On the left (image 1) is what the Fresnel node will output with a flat surface normal. Now take a look at the right hand side (image 2.)
In this image, a Normal map was input which drastically changes the surface normal.
Because the surface normal is no longer flat everywhere, you get more of the Fresnel being displayed.
In the image below, we can see how different Normal maps can affect the Fresnel in different ways.
The Material that was used to create the images above was the same Material that was created before but with the following modifications made.
The Materials Blend Mode was changed from Opaque to Translucent
The final output for the Fresnel that was plugged into the Emissive Color input was also plugged into the Opacity input.
A new 2D Texture Sampler was added and plugged into the Normal input. Tech_Hex_Tile_N from the Starter Content was used as the Normal texture.
A new Scalar Parameter was added that is multiplied by a Texture Coordinates expression to implement some basic uniform titling on the Normal map.
The Fresnel Material Expression can also be supplied with a Normal map that can affect the way the Fresnel is rendered.
This is particularly useful if you want to use the Fresnel to display something like an energy shield on a Material but still have that Material look normal when the shield is not active.
To achieve this using the Material above, the following things need to be done.
Start by Updating the Translucency Lighting Mode by changing it from Volumetric Non Directional to Surface Translucency Volume
Change the Base Color and Roughness to use the T_Brick_Clay_New_D texture from the Starter Content.
Next change the Normal input so that it uses T_Brick_Clay_New_N, which can also be found in the Starter Content.
Next search for a Transform Expression node in the Palette and add it to the Material graph. Make sure that it is set to transform from Tangent to World space.
Connect the old Normal map texture node into the input of the Transform node and connect its output into the Normal input on the Fresnel node and when completed, your Material should look something like this.
Notice how the bricks look like they have nothing to do with the Fresnel.
You can even take this one step by adding a Multiply and Constant Expression node and then using that to control the intensity of Fresnel effect.
Here is how that would look when added to the Material from above.
By adjusting the Constant that was added, you can control how the Fresnel affects the surface.
Setting the number to 0 turns off the effect and setting it to anything else will gradually reveal the effect like in the example below.