I have a project that seems to always get incorrect outputs from the ‘Absolute World Position’ node, but I can’t think of anything I may have changed that would cause this to happen.
When I move the camera around it basically slides the coordinates around like shown in this video:
This is applied to a post process material here, but the result is the same any material that uses the node. It is also only in this 1 project, if I make a new project this doesn’t happen.
Unfortunately no, I never got it fixed. It’s not causing any game-breaking bugs for me so I stopped spending time looking into it.
I was hoping to see if 5.1 ended up resolving it, and if not then maybe try looking into it again. It does screw up the debug rendering of world partition tiles which is where I initially noticed it.
Sometimes it works as expected, though. The problem seems to come from temporal sampling as it always works correctly with “Realtime Off” or antialiasing not set to TAA or TSR.
Might not be a solution for everyone, but setting the Blendable Location in the material settings from ‘After Tonemapping’ to ‘Before Tonemapping’ fixed it for me.
Defines where the post process material is evaluated in the post process graph. Depending on where your material is in the graph you will have different data and thus different output.
By default, materials are placed at the very end which means the scene color is in LDR, after exposure/tonemapping and TAA are applied. If you need the scene color before exposure is applied then you need to place your material “Before Tonemapping”. Another common reason to change the post processing location is if you are using custom stencil to mask out objects for effects such as outlines, these need to be evaluated before temporal AA is applied or they will jitter/halo annoyingly.
Placing your material before tonemapping might fix the problem in this thread, but I don’t think world position is supposed to be changing throughout the pipeline, which is why this is a bug.
The issue is still relevant, for me it only came up when in editor play, when playing in a separate window everything is fine, so I just went with it. Changing the Blendable Location did work but caused undesireable behaviour when combined with other PP effects. Applying the r.ScreenPercentage 100 command didn’t fix the issue though maybe I did something wrong.
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!