I'm working through the Unity Shader presentation, but I'm running into a problem. With the following code I only get a diffuse output, when I should be getting a specular one:
I'm pretty sure this code is right, and I'm running a Nvida 9000 series card so I don't think the shader ability of the card is to blame. Is there some setting I'm not thinking about that wouldn't allow for specular output to be rendered?
asked Jun 04 '10 at 06:34 PM
Hey, you're right. I never noticed. wtf?
I just ran some tests - lots of them. It appears that like yourself, in my copy of Unity 2.6 Pro on Windows at the time of this writing, none of the ShaderLab-based-shaders seem to do specular without a SetTexture call multiplying the primary. This should be corrected. I have confirmed that all of the built-in VertexLit shaders have such a SetTexture call, which is why they all work.
If you're looking to do it without the need for a texture in the shader, I looked at the built-in "Specular" shader and without the texture stuff, it looks like:
So, to answer your question(?), ShaderLab does not seem to be applying the specular component without a texture anymore. If you don't want a texture in your shader, you seem to need the above CGShader to perform the vertex lighting calculations. This was not how it used to be as per the Unite08 course you seem to have gotten your shader from and given Aras' above answer, it doesn't seem like it was intended to be this way.
answered Jun 29 '10 at 06:09 PM
I'm Using now Unity3.3. But it seems we have the same problem. When i Use the exact code you posted (the one on the Unite 08 presentation). I still don't get the Specular color applied. Why is that?, is there a solution that doesn't require me to write a vertex program?, please Help.
answered Apr 23 '11 at 08:31 PM
I am also having this problem.
Specifically, I would like to have no texture work done for certain geometry on the GPU, but I need vertex-only specular for that geometry.
Is there a workaround that does not include a SetTexture command?
answered Sep 15 '12 at 05:49 PM
Does adding "SeparateSpecular On" help?
answered Jun 08 '10 at 08:43 AM