Latest news
TutorialsUnreal Engine

Create a Reusable Fresnel Effect with an Unreal Engine Material Function

In this guide, we use Unreal Engine’s Material Function system to create an adjustable Fresnel effect, reuse it across multiple materials, and publish it to the library.

Soft highlights accentuating surface edges in a contemporary interiorAI image
Representative image, generated with AI.Image: 3dsınıfı / FCA AI

In brief

  1. A Material Function makes a network of material nodes reusable as a separate asset.
  2. The example Fresnel function controls an angle-dependent effect with exponent and intensity inputs.
  3. Function Input and Function Output nodes let the function receive data and return a result.
  4. Changes to an existing Material Function can affect the materials that use it.

What will you learn in this guide?

Instead of rebuilding the same node network in different materials, you can group it inside a Material Function in Unreal Engine. This lets you use a complex section as a single function call that can be added to other materials. Following Epic Games’ Fresnel example, we’ll create an effect that stands out at the edges and whose intensity and falloff can be adjusted.

Fresnel-like effects can highlight the edges of a surface based on the viewing angle and make a silhouette more visible in the dark. This implementation isn’t a physical simulation of lighting; it’s a way to add visual information to a material. The main goal is to encapsulate the calculation in the function and expose only the settings the user needs.

Requirements

The step-by-step Fresnel tutorial in the source material was created for Unreal Engine 4 and appears on the documentation page for version 4.27. The menu names and interface shown in this guide therefore follow that documentation. The sources don’t specify account requirements, hardware requirements, or product pricing.

The workflow requires working in the Content Browser and Material Editor, and creating a Material Function and a Material. The example uses these nodes: Constant 3 Vector, Transform, Camera Vector WS, Dot Product, Clamp, OneMinus, Power, and Multiply. We’ll use two Function Input nodes to make the function adjustable and a Function Output node to return its result.

Step-by-step: create a Fresnel Material Function

  1. Create the function asset. In the Content Browser, right-click and select New > Materials & Textures > Material Function. Give the function a name that describes what it does. Custom_Fresnel, used in the example, is a descriptive name that makes the function’s purpose clear.

  2. Build the first part of the angle calculation. Open the Material Function and add Constant 3 Vector, Transform, Camera Vector WS, and Dot Product nodes to the graph. Set the blue channel of the Constant 3 Vector node to 1.0. Connect its output to the Transform input, then set the Transform node to convert from Tangent Space to World Space. Connect the Transform output to the Dot Product node’s A input, and the Camera Vector WS output to its B input. This calculation uses the relationship between the surface direction and the camera direction.

  3. Clamp the result and derive the edge effect. Connect the Dot Product output to a Clamp node and constrain the value to the 0–1 range. Then connect the Clamp output to a OneMinus node. This inverts the value passed to the next stage and helps the effect stand out at the edges in the example.

  4. Define the function’s input controls. Add two Function Input nodes. Name one Fresnel Exponent and the other Fresnel Intensity; their description fields can explain what each input controls. Set both input types to Scalar. Function Input nodes let the function receive external values, which can then be connected in the material that uses the function.

  5. Connect the exponent control and intensity. Add a Power node and a Multiply node. Connect the OneMinus output to the Power node’s Base input, and the Fresnel Exponent input to its Exp input. Connect the Power output to the Multiply node’s A input, and the Fresnel Intensity input to its B input. The exponent controls the distribution of the edge effect, while the intensity controls its strength.

  6. Set the output and compile. Connect the Multiply node’s output to the Function Output node. Then click Apply in the toolbar to compile the Material Function. The source tutorial notes that the Apply button becomes inactive when compilation succeeds. If you get an error, first check the connections and input types.

  7. Try the function in a material. Create and open a new Material in the Content Browser, then add the Custom_Fresnel function to the graph. As in the example, you can connect a Constant 3 Vector node to Base Color and use red: R 1.0; G 0; B 0. Use four Scalar Parameter nodes for the other settings besides the example’s base color. Set Metallic to 1.0, Roughness to 0.5, Fresnel Intensity to 1.0, and Fresnel Exponent to 5.0. Connect the function’s output to the material’s Emissive Color input and compile the material. These values are starting settings for the example and can be changed to achieve different visual results.

  8. Optionally, publish the function to the library. Click an empty area in the Material Function graph to deselect the nodes; the function’s main properties will appear in the Details panel. Enable Expose to Library, add a description, and choose suitable categories. The function can then be listed in the Material Function Library in the Material Editor. You may need to restart the editor for a new function to appear.

Common mistakes

The first thing to check is the input and output connections: values should come in through Function Input nodes, and the calculated result should be returned through Function Output. Data connected to a function call must match the expected type; for example, connecting an incompatible type to an input expecting Scalar can cause a compilation error. To inspect an intermediate result, right-click a node and select Start Previewing Node to preview the graph up to that point.

Another risk is carelessly changing a function that’s already used in a project. Deleting a Function Input node can remove the corresponding input from materials that use the function. Errors in the function or removing its existing behavior can also affect whether connected materials compile or work correctly. Before changing a published function, review the materials that use it and test the change in a sample material.

What does it offer for architecture and visualization workflows?

If similar surface effects are reused across materials in architectural visualization, moving the shared node network into a Material Function can make it easier to organize and maintain. Updating the shared calculation in the function reduces the need to update many copied graphs individually. Edge highlights can be used for visual experimentation, particularly when you want to make a model’s silhouette more distinct. However, the sources don’t provide information about the function’s architectural rendering performance, hardware requirements, or compatibility with different Unreal Engine versions. Offices should first test it with their current version and material setup, then introduce shared functions in a controlled way.

Next steps

Start by changing the Intensity and Exponent values and examining how the result varies across the surface. Then add the same function to multiple materials to see how reuse works in practice from a maintenance perspective. Adding a descriptive name, input descriptions, and a short library description to functions shared with a team makes it easier to find the right one. When converting other material graphs into functions, keep the inputs and outputs clear: the node network inside the function should be accessible through an understandable interface.

Sources and licensing

This tutorial was adapted into Turkish based on information in Epic Games’ Material Functions Overview, Making Material Functions, and Creating Material Functions documentation. The source pages are offered under a free license; the example Fresnel workflow is based on Unreal Engine 4.27 documentation.

Sources

3 sources
D
dev.epicgames.comdev.epicgames.com/documentation/unreal-engine/unreal-engine-material-functions-overview
Summary
D
dev.epicgames.comdev.epicgames.com/documentation/unreal-engine/making-material-functions
Summary
D
dev.epicgames.comdev.epicgames.com/documentation/unreal-engine/creating-material-functions
Summary

Source texts are not republished; short quotes are marked, everything else is our own summary and commentary.

3dsınıfı’s take
3dEditor’s assessment

For architecture offices and visualization teams, the main benefit of this approach is keeping repeated material nodes in one place and making changes easier to manage. Edge highlights can also be tested quickly to make a silhouette more visible, but they shouldn’t be considered a replacement for physical lighting.

Before putting the workflow into practice, it’s important to test the example in the Unreal Engine version you’re using and check how the function affects existing materials. The sources don’t provide information about pricing, licensing terms, or hardware requirements, so it wouldn’t be right to assume cost or performance benefits. For students, starting with a small test material is a practical way to understand how the function works.

Frequently asked questions

What is an Unreal Engine Material Function for?

It lets you save a network of material nodes as a separate asset and reuse it in other materials. A complex network can be used as a single function call in a material graph.

Which values can you adjust in the Fresnel Material Function?

In this example, Fresnel Exponent controls the effect’s distribution, while Fresnel Intensity controls its strength. The example’s starting values are 5.0 and 1.0, respectively.

How do you make a Material Function appear in the library?

Enable Expose to Library in the function’s main properties and choose its categories. You may need to restart the editor for the new function to appear in the list.

Comments and the forum are in Turkish.Join the discussion
+

Related news