For the UberShader, I will try to keep needed changes to the existing art to a bare minimum, while improving its CineMut-like capabilities to a maximum:
- It will use no PRT's or bent normals, or any new textures, for that matter.
- It will only require the addition of alpha channels to existing textures, namely...
- Shininess in specular alpha
- Uniform Ambient Occlusion (UAO) in glow map alpha
- Detail Control in damage map alpha
- It will implement two detail textures: One used universally by all models and meshes globally, but very subtle, with various types of noise applied differently depending on the type of material (ripples for paints, shininess stains for metals, and "salt and pepper" noise for matte materials). The other will be user-supplied, and with controllable application. The alpha channel in the damage texture will control it in two possible modes, or none, or fades of the two modes, as follows: With alpha - 0.5, the detail texture will not be applied. With alpha below 0.5, all the way to 0.0, the diffuse mode will fade in to maximum. Diffuse mode means that the supplied detail texture is alpha-blended with the regular diffuse texture, to produce what would look like tiling painted patterns. In this mode, the detail texture's alpha channel will blend as gray with the specular texture, and with shininess, simultaneously. With damage alpha above 0.5, and towards 1.0, the supplied detail texture will be taken to mean normalmap modulation, where the red and blue channels will encode dU, the green channel will encode dV, and the alpha channel will multiply the ambient occlusion.
- There will be no way to control the frequency of detail texture tiling, however. It will be fixed at 16x for the universal detail texture, and at a fixed 32x for the user-supplied one. If a higher tiling frequency is desired, the artist can tile the detail texture itself, such as dividing it in two, vertically and horizontally, and painting the same pattern four times.
- There will be no switch to "albedo + specularity" as was planned for CineMut; the standard paradigm of separate diffuse and specular textures will be adhered to; and there will be no channel to specify dielectric constant or refractive index. Instead, the UberShader will deduce the artist's intent from the diffuse and specular colors. If the diffuse color is colorful (non-gray), but the specular color is a shade of gray, it will conclude that a paint is what the artist intended, and apply Fresnel speculartiy. Otherwise it will assume that the artist is representing a metal, and use metallic shading. One limitation of this guessing game is that it will be difficult, though not impossible, to represent gray paints. The way to represent gray paints will be to choose equal shades of gray for diffuse and specular. Metals are almost universally brighter in specular than they are in diffuse; so, using similar values will provide the shader the hint it needs to know that a gray paint is what is wanted.
- In spite of the lack of PRT's or bent normals, I will attempt to implement very soft dynamic self-shadowing (by guessing a direction for a bent normal by taking differential samples of the AO).
- Fresnel will be computed using the full Fresnel formula from physics books, like it's done in CineMut; NOT like it's done (for glass) in the current HighEnd shader, --a rough approximation which looks like crap.
- Modulation of the AO by the bumpmap will be done in the shader, relieving artists from having to run a noodle to do it off-line.
- Most importantly: Mirroring of UV maps will be permissible, for strictly symmetrical models, I believe; since a) Normalmapping can take it, since the introduction of tangents, and b) Even for the future purposes of CineMut, the PRT's were first replaced by a "bent normal", and later this bent normal was moved to tangent space, so it will handle like a normal normalmap normal. But I haven't ran this by Klauss yet...