Self-Illuminated Bumped Diffuse
Reference Manual > Built-in Shader Guide > Self-Illuminated Shader Family > Self-Illuminated Bumped Diffuse

Self-Illuminated Bumped Diffuse

One consideration for this shader is that the Alpha Channel of the Bump map also defines the Illumination Map.

Self-Illuminated Properties

This shader allows you to define bright and dark parts of the object. The alpha channel of a secondary texture will define areas of the object that "emit" light by themselves, even when no light is shining on it. In the alpha channel, black is zero light, and white is full light emitted by the object. Any scene lights will add illumination on top of the shader's illumination. So even if your object does not emit any light by itself, it will still be lit by lights in your scene.

This shader is similar to a Lightmapped shader, but there are slight differences. In this shader, the illumination map uses the same UV mapping as the main texture whereas the UVs can differ in a Lightmapped shader. Lightmapped shaders can also "emit" colored light, while Self-Illuminated emits monochrome light. This shader is also a bit more compatible with older graphics cards than a Lightmapped shader.

Bumped Properties

This shader is a Pixel-Lit shader, which is more expensive than Vertex-Lit. Pixel lighting is expensive mostly because each object has to be drawn multiple times for each pixel light that shines on it. Vertex lights don't affect the shader in this way. Pixel lights support cookies, bumpmapping, and shadows while vertex lights do not. Pixel lights are also much less sensitive to tesselation of the models - if you have a cube using this shader, you can put point light very close to its surface and it will have nice round highlight. This effect cannot be achieved with Vertex lighting.

Like a Diffuse shader, this computes a simple (Lambertian) lighting model. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on the this angle, and does not change as the camera moves or rotates around.

Bumpmapping simulates small surface details using a texture, instead of spending more polygons to actually carve out details. It does not actually change the shape of the object, but uses a special texture called a Bumpmap (also called a Normal Map) to achieve this effect. In the Bumpmap, each pixel's color value represents the angle of the surface normal. Then by using this value instead of the one from geometry, lighting is computed. The Bumpmap effectively overrides the mesh's geometry when performing lighting of the object.

Creating Bumpmaps

You can import a regular grayscale image and convert it to a Normal Map from within Unity. To learn how to do this, please read the Bumpmap FAQ page.

Technical Details

The Normal Map is a tangent space type of Normal Map. Tangent space is the space that "follows the surface" of the model geometry. In this space, Z always points away from the surface. Tangent space Normal Maps are a bit more expensive than the other "object space" type Normal Maps, but have some advantages:

  1. It's possible to use them on deforming models - the bumps will remain on the deforming surface and will just work.
  2. It's possible to reuse parts of the Bumpmap on different areas of a model; or use them on different models.

Diffuse Properties

This shader is a Pixel-Lit shader, which is more expensive than Vertex-Lit. Pixel lighting is expensive mostly because each object has to be drawn multiple times for each pixel light that shines on it. Vertex lights don't affect the shader in this way. Pixel lights support cookies, bumpmapping, and shadows while vertex lights do not. Pixel lights are also much less sensitive to tesselation of the models - if you have a cube using this shader, you can put point light very close to its surface and it will have nice round highlight. This effect cannot be achieved with Vertex lighting.

Diffuse computes a simple (Lambertian) lighting model. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on the this angle, and does not change as the camera moves or rotates around.

Performance

Generally, this shader is cheap to render. For more details, please view the Shader Peformance page.