shaderForEnvironment method
The shader to draw with against environment, picking the variant whose
radiance sampler matches the layout of the environment actually sampled
(sampledEnvironment when set). The encoder builds the pipeline from
this, and bind fills that pipeline's slots, so both must agree.
Implementation
gpu.Shader shaderForEnvironment(EnvironmentMap environment) =>
usesRadianceCubeVariant(environment)
? radianceCubeFragmentShader!
: fragmentShader;