Unity - IllumClone shader [DEPRECATED]
Unity - IllumClone shader last updated 2014-11-14
IllumClone is a universal one-sided, opaque, Blinn-Phong über-shader, intended to emulate CryEngine's Illum shader functionality in Unity engine.
Current version is: IllumClone 1.63D
Name Coding: D- deferred shader for Unity Pro, now - without DX11 features.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------F- forward shader for DX11 and Unity Free (older versions).
Diffuse term: sets base material color
Diffuse map - diffuse map is mandatory.Specular term: deals with shinyness and reflections
Diffuse tinting - adds color to diffuse texture. Currently works like Overlay blending mode in Photoshop. It allows to darken, lighten and tint base texture, while preserving contrast.
Tint color - default (no effect) color - middle grey RGB128.
Decal material - Uses diffuse map alpha channel to determine, where material is transparent. Mostly used for decals, vegetation, ironwork. Also known as alpha-test.
Specular color - is the reflective or shiny color of a material when light shines onto the object. It is a simplified reflection effect.
For non-metal materials it is always white, making highlights monochrome, only tinted by the color of incoming light. For metals, specular color is very light color of the metal itself ant it tints the reflections and specular highlights.
If you use the specular map, leave the specular color white.
Fresnel effect: amount of reflectance you see on a surface depends on the viewing angle.
All materials exhibit Fresnel effect!
Currently, because of Unity limitations, we use heavily cheated effect, that does not use physical IOR values, but exponent and bias
Fresnel exponent - values 0-8.
Fresnel bias - values 0-1.
Note: In Blinn-Phong shading model, reflectivity is affected by Fresnel effect in such way, that full value of specularity or specular map is applied to surfaces, parallel to viewing direction (grazing angles), and is masked most in surfaces, perpendicular to viewing direction. The reflectivity and shinyness of material is greatly affected by Fresnel values. So it is recommended, if judging specularity by eye, to set Fresnel values first, before Specular ones.
Specularity - values o-1. It is the 'strength' of reflection or 'shinyness'. It is tied to diffuse color in energy conserving manner, so the more specular (reflective) the surface is, the less diffuse color it shows. For ex.: mirror or chrome has specularity of almost 1, and do not show diffuse color, which is very dark grey.Normal mapping and displacement:
Using specular map, specularity value has no influence.
Use specular map - works like combined effect of Specular color and Specularity. The luminance determines how reflective the pixel is, and hue/saturation adds tint for metal reflections.
Great reference for specular maps of different materials can be found here.
Glossiness - values 0-1.
New!Use gloss map - takes glossiness values from _SPEC texture alpha channel.
Most materials should have a gloss map, as it can give a lot of good variation to the shading. Gloss is closely related to normal maps, as high frequency details in a normal can create some feeling of roughness as well. However, gloss is more the micro-scale roughness of the material.
Use normal mapping - self explanatory.Image Based Lighting (advanced): controls are exposed only while it isn't handled automatically.
Normal map - For correct display in scene viewport, normal maps have to be marked in material inspector for compression as 'Normal map'.
Normal map strength is not adjustable, so set the correct value outside Unity.
POM - Parallax Occlusion Mapping. It's a depth effect given to your surfaces with the help of displacement map, it does not however change surface, so object contours stay the same.
Use it sparingly! Best use is for surfaces of strong relief and sculpted details.
POM height - Perceived depth of POM effect. Beware, stronger values easily break the perspective.
Displacement map - currently only alpha channel is used for POM heightmap.
In heightmap, white color is taken as default surface height. To 'recess' surface deeper, use darker tones.
Image based lighting is the method to handle scene lighting without direct light sources, and to fake reflections. Unity's light probes work the same way. Textures, called cubemaps, are employed to to project lighting information to each object's surface (Diffuse IBL) and to add static pre-baked environment reflections to reflective surfaces (Specular IBL).Vertex colors: Enables vertex color reading for masking Dirt and Blend layers.
Diffuse IBL On - Off value defaults to uniform Ambient light, settable in project settings.
Use RGBM cubemaps - it's the default way. High dynamic range cubemaps, in order to store information outside RGB 0-255 range, use alpha channel for luminance multiplier.
Diffuse RGBM multiplier - Set it in 1-16 range, depending on cubemap, used in the scene. Multiplier is multiplied with pixel values in RGB and alpha channels to get HDR pixel values.
Specular IBL On - Off value has no environment reflections, and only direct light sources form specular highlights.
Use RGBM cubemaps - the default way.
Specular RGBM multiplier - Set it in 1-16 range, depending on cubemap, used in the scene. It is multiplied with values in RGB and alpha channels to get HDR pixel values. Verify the multiplier in mirror material (Specularity=1, Glossiness=1); The reflection should be the same intensity as the skybox.
Helps re-use small quantity of dirt maps for multiple situations.
Dirt layer: allows you to blend another texture onto your base material without the need to place an extra decal.
Dirt layer has only Diffuse texture with layer mask in alpha channel.
Dirt texture - dirt texture slot, is tiled (doesn't use UV set).
Dirt tint color - tints dirt texture. Currently works like Overlay mode in Photoshop.
Use dirt specularity - Switches to individual specularity slider for dirt layer. If dirt layer has same specularity as base material, uncheck for better performance.
Dirt specularity - values 0-1.
Use dirt glossiness - Switches to individual glossiness slider for dirt layer. If dirt layer has same glossiness as base material, uncheck for better performance.
Dirt glossiness - values 0-1.
Blend layer: allows mixing a second set of textures with the base set to get more variation on tiled surfaces.
(page is being periodically updated)