paritySettingsFor function

RenderSettings paritySettingsFor(
  1. ParityScene which
)

The settings each fixture is drawn with.

Everything not under test is switched off, so a scene that disagrees says which feature disagreed. A fixture with shadows and bloom would report one number for two questions.

Implementation

RenderSettings paritySettingsFor(ParityScene which) => switch (which) {
  ParityScene.plain => const RenderSettings(
    bloom: BloomSettings(enabled: false),
    shadows: ShadowSettings(enabled: false),
  ),
  ParityScene.directionalShadow ||
  ParityScene.pointShadow ||
  ParityScene.torchNearWall ||
  ParityScene.torchesRunningOut => const RenderSettings(
    bloom: BloomSettings(enabled: false),
  ),
  ParityScene.bloom => const RenderSettings(
    shadows: ShadowSettings(enabled: false),
  ),
  // The atlas on screen instead of the picture. Exposure and tone mapping
  // are forced off by this path in the compositor, so the comparison is of
  // the stored distances themselves.
  ParityScene.pointShadowMap => const RenderSettings(
    bloom: BloomSettings(enabled: false),
    showShadowMap: true,
  ),
  // The other cube atlas, which nothing had ever looked at. See the note
  // on `ParityScene.pointShadowStaticMap`.
  ParityScene.pointShadowStaticMap => const RenderSettings(
    bloom: BloomSettings(enabled: false),
    showStaticShadowMap: true,
  ),
  ParityScene.sky => RenderSettings(
    bloom: const BloomSettings(enabled: false),
    shadows: const ShadowSettings(enabled: false),
    sky: _paritySky,
  ),
  ParityScene.imageBasedLighting => const RenderSettings(
    bloom: BloomSettings(enabled: false),
    shadows: ShadowSettings(enabled: false),
  ),
  // Turned up far past taste: a fixture that applied a look nobody could
  // see would compare two pictures of the same thing and agree.
  ParityScene.look => const RenderSettings(
    bloom: BloomSettings(enabled: false),
    shadows: ShadowSettings(enabled: false),
    look: LookSettings(
      contrast: 1.35,
      saturation: 1.4,
      temperature: 0.25,
      vignette: 0.6,
      grain: 0.08,
      chromaticAberration: 0.004,
    ),
  ),
};