occlusionTarget function

double occlusionTarget(
  1. ShaderBindings b
)

OcclusionTarget: which light the occlusion darkens, 0 both, 1 direct only, 2 indirect only — RenderMaterial.occlusionAffects, packed into material2.z as twice itself beside the strength.

Implementation

double occlusionTarget(ShaderBindings b) =>
    (b.vec4('FragInfo', 'material2', Vector4.zero()).z * 0.5).floorToDouble();