PixelNormalWS breaks on Android but works in all preview modes
We wanted to add a custom light source inside our character material. We supply a vector parameter, being world location, and then we calculate a simple Phong shader. (calculate world vector -> normalize -> dot(light vector, surface normal))
Our shader works in PIE, StandAlone, Mobile Previewer and the experimental Feature Level Preview ES2.
Shader breaks after deployment to mobile. It seems the PixelNormalWS node returns a default value rather than the actual surface normal. So light source always appear to light the same side of the model, no matter what value we supply to the vector parameter.
I managed to solve the problem by fetching the normal map color and then transform the tangent vector to world space. Same result as PixelNormalWS, but does not break on mobile.
This is the shader network that we use.
asked Dec 16 '14 at 10:51 AM in Rendering
Hey Denny -
I was able to track down the issue and it has been fixed in the internal branch of the engine. It should be forthcoming in a Hot Fix or Major Engine Release.
answered Dec 19 '14 at 09:25 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here