Hi, I’m pretty new to Unreal, so please forgive me if this is a dumb question. How can I get screen space normals in a material? I’ve found a way to get world space normals, but not screen space. View space normals would be ok, too, if that works in Unreal. Pixel or vertex normals are fine- both would be even better.
If you want vertex normals in screen space, place down “Vertex Normal” node and then a transform node (not transform position, just transform) with the source set to WorldSpace and the destination set to ViewSpace. Then go to the material properties and uncheck “Tangent Space Normal”. You may need to flip the normals by multiplying by -1 depending on what you are trying to do.
For pixel normal just replace “VertexNormalWS” with “PixelNormalWS”.
Awesome! Thank you! This is exactly what I needed. I actually ended up using a method I found here:
The first seven nodes on the left end up giving me a screen space normal, minus the blue channel. Your way is so much simpler, so I’m switching it out.
Hello. I am trying to convert camera space normals into UV for rendering matcap material. Workflow is following:
Getting pixel normals in world space
Converting them to view/camera space
Multiplying vector to matrix 0.5, 0, 0 ], 0, 0.5, 0 ], 0, 0, 0 ], 0.5, 0.5, 0 ]] so i get xy in range from 0 to 1
Converting vector3 to vector2 and using it as UV coordinates.
Problem is as shown on picture i am getting perspective distoring when shader works. I have not found where to uncheck “Tangent Space Normal” as Ryan Brucks adviced. Somebody have idea please how to fix issue with perspective distorting?