A modified version of the Standard Shader that can be found bundled with Unity. Extended mask, uv, and map capabilities.
This variant of the Unity Standard Shader was created for a specific use case in the Bygone game project, namely using the detail maps to apply various high quality detail (detail pieces of wallpaper, paint remnants, scattered paper, small debris etc.) to large surfaces with tiled square base maps (the details being applied according to the detail UV set).
The purpose was to increase variety in the environment, while maintaining a single mesh workflow and providing sufficient optimization. The shader functionality was proposed and partly designed by my fellow game-designer, writer, and 3d artist M-Klekowicki. He also provided help with the research and testing.
The changes made to the code are as follows:
- The choice of the Detail Map UV set, was extended from the default UV0/UV1 to UV0/UV1/UV3. The UV3 variant for the Detail Maps, prevents the conflict in which the Detail UV Set is overwritten by the Lightmap UV when the Detail Map occupies the second UV slot.
- LERP is now set as the default method of mixing between the primary and secondary maps. I plan to implement a choice between the methods (LERP, MULX2, MUL, ADD), but I’ve hit a wall in this case. Anyone willing to help implementing the function is more than welcome.
- The biggest change involves Specular Maps that are now an option for the secondary detail maps. Also, if the Specular Map is not provided, the option is replaced by the choice of a specular colour (just like with the base maps) and a slider controlling the influence of the primary specular map on the secondary detail specularity.
- Smothness map for the detail maps are now an option. When no SpecularityMap with Smoothness in Alpha is present, the alpha of the specularity controls the influence of the base SpecMap on the details.
- Mixing method choice.
- Implementing similar changes to the metallic variant of the standard shader.
You can download unitypackage.