From f5f22152eb236831cb9f23646445e6459be18285 Mon Sep 17 00:00:00 2001 From: Daniele Pelagatti Date: Sat, 2 Dec 2023 22:10:31 +0100 Subject: [PATCH] fix(encode): hdrCapacityMax correctly computed in output metadata --- src/encode/materials/GainMapEncoderMaterial.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encode/materials/GainMapEncoderMaterial.ts b/src/encode/materials/GainMapEncoderMaterial.ts index 1d86ae5..accb0da 100644 --- a/src/encode/materials/GainMapEncoderMaterial.ts +++ b/src/encode/materials/GainMapEncoderMaterial.ts @@ -159,5 +159,5 @@ export class GainMapEncoderMaterial extends ShaderMaterial { * @see {@link GainMapMetadata.hdrCapacityMax} * @remarks Logarithmic space */ - get hdrCapacityMax (): number { return Math.min(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])) } + get hdrCapacityMax (): number { return Math.max(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])) } }