How to transform scene texture normal from world space to camera space?

First I set a post process volumn and then use scene texture ‘world normal’ to get world space normal. I tryed to use ‘transform’ node to transform it from world space to camera space but it seems failed. How should I do?


and this is the results:

What I want :

It’s correct, it’s just missing the Z component and is in -1,1 range

1 Like

Thanks a lot! Now it looks correct:


However, I have another question: the coordinate system of UE and OpenGL is different and I do nothing to transform the aixs. But the current result seems to be correct: R denotes right, G denotes up and B denotes back (form screen to eyes). Is this reasonable?
And I noticed that normal of sky changes with different pose of camera, this is a little bit strange. I guess it results from the shape of sky in this scene.

(post deleted by author)

I think so but I can’t quite remember. The only difference between OpenGL and DirectX tangent space normal map is that the green channel of one is the inverse of the other. So it should be simple enough to fix if it’s wrong (just break the green channel and run it through a 1-x node)

Sky probably shouldn’t have a normal, you could fix this by setting a cutoff distance that just returns 0.5,0.5,1.0 after a certain distance. You can do this with the scene depth as alpha for a linear interpolate.