Getting incorrect output from 'Absolute World Position' in materials

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.

Here’s the post process material for reference.

The shader offsets are set to: “Including Material Shader Offsets” but the results are same on any of the settings.

Anyone have any ideas that can help me out?

Did you ever manage to fix this? I thought my math was wrong but I think this is the culprit

Probably this issue?

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.

Same problem :frowning:

Even 5.1 didn’t fixed issue. WorldPosition.z in post process outputs incorrect values in Temporal AA

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.

2 Likes

Worked for me as well, thanks!

But… does it do anything? What is that setting for actually?

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.

Hey any update on that topic ?
I need TAA activated and can’t put my material before tonemapping :confused:

using the command line r.ScreenPercentage 100 “fixes” the issue