2car
(2car)
November 1, 2019, 1:27pm
16
anonymous_user_f2b8b290:
Lightmap UVS are actually a geometry attribute and not lighting. They are used to map the lighting to the surface, but they describe the surface. That is the role of materials - describe the surface, and how it interacts with light. Then the renderer can combine that material with light sources in an efficient way to compute shading.
There are some other exceptions though where they are not fully decoupled: material ambient occlusion, AO Material Mask. These cause a lot of problems due to the coupling. For Material AO, we have to store it in the GBuffer which decreases performance, even though it is rarely used. For AO Material Mask, it’s only available in the Base Pass but not in the depth only or Shadow Depth passes. So for example if you use Material AO in your opacity mask, the passes will not match up and things will go poorly.
Bottom line - materials describe how a surface interacts with light, but should not do the actual lighting. However, you can modify the engine to do whatever stylized behavior your project wants!
Another inconsistency is the precomputed AO mask. It works fine for shader access from regular lightmaps, but not for volumetric lightmaps. Is this intended?