From 2966dbcfefd98aa23e0f429ff98ab1055fc1da22 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Wed, 2 Oct 2024 16:18:33 +0900 Subject: [PATCH] Fix toneMapping reference 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"; }