From d235cb694ee0b9cfe51ac82b73b9171681cacceb Mon Sep 17 00:00:00 2001 From: Greggman Date: Fri, 18 Oct 2024 18:56:21 +0900 Subject: [PATCH] Fix toneMapping reference (#455) AFAICT, the spec requires toneMapping period. Even if the browser doesn't support toneMapping.mode = 'extended' it requires it still requires it to exist. It will just be set to `'standard'` if the implementation does not support `'extended'`. The only other case is when the canvas has not been configured in which case `getConfiguration` returns undefined. Both `getConfiguration` and `toneMapping` were added to the spec close enough that any implemetation that supports `getConfiguration` should be requried to include `toneMapping`. --- sample/particles/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample/particles/main.ts b/sample/particles/main.ts index 2af352e1..afe308ae 100644 --- a/sample/particles/main.ts +++ b/sample/particles/main.ts @@ -355,7 +355,7 @@ function getHdrFolderName() { } if ( simulationParams.toneMappingMode === 'extended' && - context.getConfiguration().toneMapping?.mode !== 'extended' + context.getConfiguration().toneMapping.mode !== 'extended' ) { return "HDR settings ⚠️ Browser doesn't support HDR canvas"; }