Getting incorrect output from 'Absolute World Position' in materials

A solution to calculate a corrected WorldPosition exists!

Huge thanks To Dan Gant from the Unreal Slackers discord, and his elegant and clear solution (https://discord.com/channels/187217643009212416/221799195806400512/1325549330102485035)
Here is his solution:

Step 1: Create this first material function (I named it MF_CameraToPixelDirection_FromViewportUVAndSceneDepth_ForPostProcessMaterialsFix):

Step 2: Use it in this second material function (I named it MF_WorldPosition_FromViewportUVAndSceneDepth_ForPostProcessMaterialsFix):

You can then use the MF_WorldPosition_FromViewportUVAndSceneDepth_ForPostProcessMaterialsFix’s Absolute World Position output instead of your normal World Position node.

Read the comments to understand the root of the problem and why the solution works!

1 Like