applyCommonMaps function
void
applyCommonMaps(
- Surface s,
- Float32List v,
- ShaderBindings b,
- FragmentContext c, {
- bool transformed = false,
The three every lit model uses. Metal-rough is separate because only the models that respond to metallic or roughness may sample it.
Implementation
void applyCommonMaps(
Surface s,
Float32List v,
ShaderBindings b,
FragmentContext c, {
bool transformed = false,
}) {
// `L3`: the field in place of the hemisphere, before the normal map, as
// `ApplyCommonMaps` does it.
if (irradianceEnabled(b)) {
final strength = b.vec4('FragInfo', 'material', Vector4.zero()).z;
s.ambient.setFrom(
sampleIrradiance(b, s.world, s.normal, s.view)..scale(strength),
);
}
applyNormalMap(s, v, b, c, transformed: transformed);
applyOcclusionMap(s, v, b, c, transformed: transformed);
applyEmissiveMap(s, v, b, c, transformed: transformed);
}