- Home /
Sphere and normal mapping problem with Shader Graph
This is probably something relatively simple but I am new to shader graph and don't have that much shader experience in general.. I have an ocean shader that alters the normals to create this watery effect on the surface. This works plenty fine when I apply the shader to a quad or a plane, but when I apply it to a sphere, this happens.
In my mind, the issue is that the normals are not rotated properly when not working on a plane. How can I make the normal adjustment for the water effect be relative to the original normal of the fragment to make this work on any surface? I have tried:
Multiplying the normal with world space normal vector
Multiplying the normal with object space normal vector
Multiplying the normal with tangent space normal vector
Multiplying the normal with view space normal vector
None of these helped and at least tangent space had weird results.
I'm not entirely sure how you are doing this, but normal mapping is ordinarily done using a TBN matrix - a 3x3 matrix consisting of first the tangent, then the bitangent (cross product of normal and tangent) and finally the normal. You can then multiply the normal map by the transpose of this matrix to convert the normals from tangent space (in which normal maps are stored) to world space.
Thank you, I'll give it a shot! Haven't solved this yet, but I had decided to defer the problem until later.
Your answer
![](https://koobas.hobune.stream/wayback/20220612235020im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why does spec map turn object black? 0 Answers
Dynamic Skybox 0 Answers
Projecting a plane onto a sphere 2 Answers
Fake specular shader for a sphere? 1 Answer