- Home /
Shader results don't make sense
I grabbed one of Unity's example shaders here (http://docs.unity3d.com/Documentation/Manual/ShaderTut2.html) and dropped it onto my model. But the results don't make any sense. The result is here http://i.imgur.com/01yUZdc.png.
As far as I can tell, the shader sets the pixel's color based on it's normal. Since the model is a bunch of boxes, each face should have the same normal. So I should see a bunch of different solid colors. Not gradients. And when the pixels wrap around an edge, the color doesn't change at all! The normal should have changed by 90 degrees causing an abrupt change.
Does anyone know what's going on here or know how I can get this to color based on the real normals?
Answer by Owen-Reynolds · Jul 19, 2013 at 03:17 AM
Your cube model appears to be smooth-shaded, so should look that way. If you look with a diffuse white shader, the sides probably have a similar odd gradient. Does it have 8 verts? Try it on the Unity cube (which has all sharp edges, so 24 verts.)
Your answer
![](https://koobas.hobune.stream/wayback/20220613110418im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Specular and normal map artefacts problem 3 Answers
Shaders are failing to load 1 Answer
Unity 5 fragment shader that writes custom depth into the depth texture 1 Answer
Texture shows up black when using anything but unlit shaders 0 Answers
How to write shader for hard light blend mode in unity 1 Answer