- Home /
The question is answered, right answer was accepted
Make Unity Unlit Shader use normal maps.
Hey everyone, I've been trying to make a toon shader for a project of mine and wrote a Ramp Shader as Unity Unlit Shader. The Ramp is controlled by a fake Light object in the scene, so I wanted to try and add a normal map on top of the Main Texture and Ramp Texture but I have no idea how to approach this as Unity Unlit Shaders are... unlit and therefore are apparently not able to take normal maps? Any advice on that?
That's not how that works. An unlit shader is specifically created without lighting information and a normal/bump map REQUIRES lighting information. There is no way to use a normal map without lighting, if you were to write a shader to accommodate for your custom light, you'd basically just be writing a lit shader. So a better question. Why do you think you need an unlit shader with a normal map?
Thanks for the reply! It totally makes sense, I was thinking of that too but i wasn't sure if my guess was right so you basically confirmed it to me and i'm one step smarter. The reason I wanted the normal map in an Unlit Shader is because I'm only familiar with the struct, vert, frag, functions of the basic Unity Unlit Shader, so i'm not sure how to convert my functions into a LitShader. I will need the normal map to be on my 3D model though, so I was trying to think of a way to add these to my Ramp and Outliner functions in the Unlit.
That's almost accurate.
You don't have to have lighting information to display a normal map if you're using the normals directly as color data.
In terms of the lighting scheme itself, however, a distance-driven fake light won't see any changes in distance from a normal map, so it won't provide any benefit in that case.
For a variety of examples of vertex/normal shaders, this is a handy place to start.
Follow this Question
Related Questions
How to store all vertex normals within a shader file 0 Answers
Custom shader with unlit textures is too bright 0 Answers
compute shader in order access of pixels 0 Answers
Unlit Shader with Shadows from point lights. 1 Answer
How to fInd World Coordinates of point visible at centre of screen/camera? 1 Answer