- Home /
Specular vs. Emission in Surface Shader?
Reading through the examples for custom lighting in Surface Shaders, there is an o.Emission property that is used in the same manner of Specular. The usual definition for emission is that it 'emits'. When should emission be used opposed to specular?
(Is there some better docs for what the built-in values for Surface Shaders are? )
Answer by Paulius-Liekis · Jun 07, 2011 at 08:46 PM
As you said "Emission" emits light (i.e. object shines - it doesn't get darker if it's not lit by light). Specular just defines how much "specular part of light" should be used.
(these descriptions sound funny even to myself:))
That would explain its use in the cubic map example. The image gave a bit of a plastic wrap effect, but the real effect there is the lack of light source. Good to know. Thanks.
(Any other docs/links on this?)
Answer by Wolfram · Jun 07, 2011 at 09:04 PM
"Specular" influences the intensity of viewer-dependent highlights caused by lightsources in your scene. The "spread"/sharpness of these highlights is influenced by "Shininess".
"Emission", on the other hand, is the "self-illumination" of the material, and therefore not influenced by any lightsources whatsoever. If you set Emission to Color.red, your object will be fully-red, anywhere, even in shadows/shades.
They are therefore quite different.
When to use:
Emission is used for glowing objects, illuminated buttons, etc.
We usually set "Emission" to white, if we have a textured plane in camera space which we use for (3D-)GUI elements. In fact, in this case we use a "VertexLit" shader, set "diffuse/main color" to black, and "specular" to black, and "emissive" color to Color.grey (=50% grey; 100% white will overshoot), which has the same effect, but the VertexLit-Shader is rudimentary OpenGL, and should be faster than an arbitrary complex Surface shader, not sure.
Setting the other colors to black and the emission color to "full" 50% will recreate the full texture colors/brightness, no matter where (or if) lightsources are in the scene.
Another way to state Specular is that it's the 'shininess' of an object, so something like chalk wouldn't have much, but polished metal or glass would have a lot. Being in the same texture, it means you can mix it up, so your image of, say, a mud puddle can have not-so-shiny mud as well as pretty-shiny water in it.
The confusion lays in the fact that the Surface Shader example for Cube$$anonymous$$ap Reflection uses Emission ins$$anonymous$$d of Specular when the effect that is created is Specular looking. see: ../Documentation/Components/SL-SurfaceShaderExamples.html
@JBC: True, the problem ist that all lighting effects are already included within the Cube$$anonymous$$ap texture, so when applying the Cube$$anonymous$$ap, you don't want to add additional lighting effects, but ins$$anonymous$$d just display the Cube$$anonymous$$ap unaltered. And that is exactly what Emission does.