Refraction Using Pixel Normal Offset in UE4
Events
Subscribe:  iCal  |  Google Calendar
7, Mar — 1, Jun
York US   26, Mar — 29, Mar
Boston US   28, Mar — 1, Apr
Anaheim US   29, Mar — 1, Apr
RALEIGH US   30, Mar — 1, Apr
Latest comments

This is amazing! Please tell us, What programs where used to create these amazing animations?

I am continuing development on WorldKit as a solo endeavor now. Progress is a bit slower as I've had to take a more moderate approach to development hours. I took a short break following the failure of the commercial launch, and now I have started up again, but I've gone from 90 hour work weeks to around 40 or 50 hour work weeks. See my longer reply on the future of WorldKit here: https://www.youtube.com/watch?v=CAYgW5JfCQw&lc=UgxtXVCCULAyzrzAwvp4AaABAg.8swLeUjv7Fb8swt1875FAT I am hard at work with research and code, and am not quite ready to start the next fund-raising campaign to open-source, so I've been quiet for a while. I hope to have a video out on the new features in the next few weeks.

Someone please create open source world creator already in C/C++.

Refraction Using Pixel Normal Offset in UE4
22 May, 2018
News
Tutorial

Take a survey

Have a look at a detailed article on Unreal refraction using Pixel Normal Offset. This official guide will help you understand the basics. 

In Unreal Engine 4, we now make use of a non-physical model of refraction, Pixel Normal Offset. The built-in code, using the physical model of refraction for Index of Refraction, is based on how light rays refract as they transfer between mediums, which can cause a lot of artifacts as the scene color is being read from off-screen. This can be useful for small objects, like glass jars, where you won’t notice the effect as much, but is problematic for flat surfaces. Pixel Normal Offset enables refraction for these large flat surfaces, like water, where you do not want this constant offset that is reading from off screen so much. It uses the vertex normal as a reference and then computes the refraction offset from how different the per-pixel normal is from the vertex normal, allowing these flat surfaces not to shift.

To enable refraction to use the Pixel Normal Offset mode, select the Main Material Node and use the Details panel to set the Refraction Mode: 

RefractionSettingPNO.png

Physical vs Non-Physical Model of Refraction

In the comparisons below, the Refraction Modes for the physical model of Index of Refraction and the non-physical model for Pixel Normal Offset demonstrate the differences in how the normal is read in the material.

For additional information about the physical model of refraction and using it with your materials, see Using Refraction.

Refraction Mode: | Index of Refraction

Refraction Mode: Index of Refraction

Refraction Mode: | Pixel Normal Offset

Refraction Mode: Pixel Normal Offset

Here you will notice that the image is shifted when using the Index of Refraction mode compared to the Pixel Normal Offset mode where you do not read from off screen so much. Index of Refraction will work without a Normal map plugged into the material, whereas with Pixel Normal Offset, if there is no Normal map you will not get any refraction.

Refraction Mode: | Index of Refraction

Refraction Mode: Index of Refraction

Refraction Mode: | Pixel Normal Offset

Refraction Mode: Pixel Normal Offset

When you add a Normal map to your material, with refraction and a value greater than 1 plugged into your Refraction input, the normal will translate along the surface when using Pixel Normal Offset. However, you will notice that with Index of Refraction, you will still have an offset that reads from off-screen, which is not a desirable effect for these flat surfaces using refraction.

Final Results

In this example, the refraction amount is adjusted between a value of 1.0, which is no refraction at all, to a value of 2.0, for some refraction along the surface without shifting the image while usingPixel Normal Offset.

The guide was originally published here.

Leave a Reply

avatar
Related articles