Fresnel Experiments in Amplify Shader Editor

Dec 31, 2019 at 03:30 pm by nemirc

This time I would like to take a look at the Fresnel effect in Amplify shader. I really like the Fresnel a lot because it allows you to add the peach-skin effect to your shader. While the peach-skin effect is mostly used to add the "peach-fuzz" effect on skin, it can also be used for other interesting looks. For example, I created a custom shader using Amplify to make velvet-looking material to use it on the outfits of the protagonist, as part of the visual style but also to accentuate the contour of the character. Keep in mind that, while I am using Amplify Shader for Unity, you could do something similar in any other node-based material editor (including the UE4 material editor), even if naming is a little bit different.
First, let's create a new Amplify shader, a material (that we apply the shader type to), a sphere, and add the new material to the sphere. I always do this because I like to see the material in the scene. You will have a pitch-black sphere, and we are going to start playing with it now. First you can add a Fresnel node, and connect it to the Albedo input. You will get your basic fresnel effect.
It is very useful to be able to tweak the effect, so I use variables for that. Create two Float nodes (set them to "Property") and then plug them to the scale and power inputs. I set my scale as a variable that goes between 0 and 1, and my power from 0 to 10. If you re-compile the material, you will have two sliders, and if you move the sliders you will see the fresnel effect be affected by that. Basically, the power variable controls how much it "spreads" from the edges to the center (meaning, from a completely perpendicular normal, to a camera-facing normal), and the scale controls the strength.
One thing you will notice is that the power applies an inverted effect. Meaning that, the higher the number, the less it spreads. Amplify has a node called "Remap" that can help you make the slider behave in a more coherent way. Simply create the Remap node, plug the Power float variable to it and then plug the Remap to the Power input in your Fresnel, and then configure it the way shown below:
After you compile again, you will notice that increasing the value on the Power slider of your material actually increases the spread along the surface.
Another interesting thing you can do is plug a normal map to the Fresnel node (also plug it to the Normal input of your shader). When you do this, the fresnel effect will be affected by your object's normal map.
Most of the time you want to be able to control the color of your peach-skin effect. To do this, simply multiply the Fresnel output by a color.
Most of the time, you will be using this to add a peach-skin effect to your material, or a "glow rim" effect if you plug this effect to your Emission channel instead of your Albedo. However, you can also do other interesting things. For example, if I add a Metallic slider, and plug the Fresnel output to the Smoothness channel, I get this interesting effect where the material gets more reflective as the normals face away from the camera.
Another interesting thing you can do with this node is make the effect be connected to your light direction, not your camera view. In the image below you can see I set the View Vector (of the Fresnel node) as Light Dir. The fresnel effect now appears on the unlit area of the sphere.
Above I mentioned the Remap node as a way to "invert" the behavior of a variable. You can actually use this to remap the output of the Fresnel. For example, imagine that, for some reason, you want an inverted peach-skin effect where the object becomes clearer as its normals face the camera, and darker as its normals face away from the camera. You can easily do that with a Remap node, as seen below.
And that's it for this time. I hope you found these tips useful, and that you have fun experimenting with fresnel effects.

Sign up for our newsletter

This website uses cookies to ensure you get the best experience possible More Info
Got it!