- Home /
bumped self illumination shader question
I was wondering what the best way to use the bumped self illumination shader is. I have read through the help pages and understand that unity takes the alpha channel from the normal map as the self illumination value, my only problem with this is that Unity asks me to set the normal_map.png file that I've made to a Normal texture in the texture import section. Once I do this the self illumination looks wrong, if I keep it as a Texture then the self illumination looks right but the normap mapping looks wrong. I've worked around it by creating a normal_map.jpg, set this to be a Normal Texture, and then created a self_illumination.png which is plain white with the alpha channel containing the information. This works but seems silly to me to now have 2 texures when the documentation says I only need one. Please help!
Answer by ScroodgeM · Jul 14, 2012 at 12:39 PM
are you talking about built-in shader "Self-Illumin/Bumped Diffuse"? it has a "Illumin (A)" texture for illumination. shader uses this (only this) texture to make illumination. illumination color taken from diffuse texture. normal-map can't contain alpha-channel and it's impossible to use normal-map for something but normal-mapping
Answer by enginehouse · Jul 15, 2012 at 05:19 PM
Yes I'm talking about the built in shader 'Self-Illumin/Bumpted Diffuse'. I would agree taking the illumination from the alpha channel of the normal map is a bit weird, but the documentation says this is the case. It says "One consideration for this shader is that the Alpha Channel of the Normal map also defines the Illumination Map." link here: http://docs.unity3d.com/Documentation/Components/shader-SelfIllumBumpedDiffuse.html
I'm not sure why this would be the case, as I mentioned before it works fine but messes the normal information up, until I set the normal map to be a normal map in the inspector, and then normals work find but self illumination doesnt work.
i'd check source for shader described at link above, but there's no use alpha channel from normal map in any way. i think it's a error in docs...
create duplicate of your normal map with alpha
one copy of it mark as normal map and fill "normal map" field in material
second copy of it mark as normal texture and fill "illu$$anonymous$$ation map" field in material
this should work. really you need texture with alpha channel only for illu$$anonymous$$ation
Answer by TLMultimedia · Jan 16, 2015 at 03:06 AM
I too followed the Unity Manual for Self Illum Bumped Diffuse and sure enough @ScroodgeM is correct and it does not work. The only way I can get the Alpha on the normal map file to respond as a light map is by leaving it a default texture type which is clearly no use for the normal map.
The documentation is clearly either incorrect or lacks a suitable explanation of how any work-around would be achieved.
Odd that the documentation would remain incorrect for 2 1/2 years but I can think of no other explanation.
Your answer
Follow this Question
Related Questions
WorldNormalVector(IN, o.Normal): how is it calculated? 3 Answers
How can I add Normal mapping to a Terrain custom shader? 0 Answers
Shader: actual view direction/normal? 2 Answers
Normals face correctly, but lit reversed 1 Answer
Fading Normal Map 1 Answer