Skip to content

Commit 3ed05fa

Browse files
authored
make PBR Neutral our default tone mapper (#4886)
* make PBR Neutral our default tone mapper * update effects default * update goldens * updated docs
1 parent 2fd5094 commit 3ed05fa

File tree

99 files changed

+151
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+151
-112
lines changed

packages/model-viewer-effects/src/effect-composer.ts

Lines changed: 126 additions & 86 deletions
Large diffs are not rendered by default.

packages/model-viewer/src/features/environment.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ export const EnvironmentMixin = <T extends Constructor<ModelViewerElementBase>>(
8888
}
8989

9090
if (changedProperties.has('toneMapping')) {
91-
this[$scene].toneMapping = (this.toneMapping === 'commerce' ||
92-
this.toneMapping === 'neutral') ?
93-
NeutralToneMapping :
91+
this[$scene].toneMapping = this.toneMapping === 'aces' ?
92+
ACESFilmicToneMapping :
9493
this.toneMapping === 'agx' ? AgXToneMapping :
95-
ACESFilmicToneMapping;
94+
NeutralToneMapping;
9695
this[$needsRender]();
9796
}
9897

Binary file not shown.

packages/modelviewer.dev/data/docs.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,13 +897,13 @@
897897
{
898898
"name": "tone-mapping",
899899
"htmlName": "toneMapping",
900-
"description": "Selects the function that compresses the HDR rendering to an SDR image on your screen. ACES is a film industry standard that is commonly used, though it has serious color-accuracy problems. AgX is a new and improved tone mapper seeing broad adoption in film and games. Khronos PBR Neutral ('neutral') is a standard function designed specifically for accurate color reproduction in e-commerce. Our current default is and has been ACES, but in v4.0 this default will change to neutral. The deprecated name commerce is an alias for neutral.",
900+
"description": "Selects the function that compresses the HDR rendering to an SDR image on your screen. ACES is a film industry standard that is commonly used, though it has serious color-accuracy problems. AgX is a new and improved tone mapper seeing broad adoption in film and games. Khronos PBR Neutral ('neutral') is a standard function designed specifically for accurate color reproduction in e-commerce. Our current default is neutral, but prior to v4.0 this default was ACES. The deprecated name commerce is an alias for neutral.",
901901
"links": [
902902
"<a href=\"../examples/lightingandenv/#toneMapping\"><span class='attribute'>tone-mapping</span> example</a>"
903903
],
904904
"default": {
905-
"default": "aces",
906-
"options": "aces, agx, neutral"
905+
"default": "neutral",
906+
"options": "neutral, aces, agx"
907907
}
908908
},
909909
{

packages/modelviewer.dev/examples/annotations/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ <h4></h4>
107107
display: none;
108108
}
109109
</style>
110-
<model-viewer id="hotspot-demo" ar ar-modes="webxr" camera-controls touch-action="pan-y" src="../../shared-assets/models/Astronaut.glb" poster="../../assets/poster-astronaut.webp" shadow-intensity="1" alt="A 3D model of an astronaut.">
110+
<model-viewer id="hotspot-demo" ar ar-modes="webxr" camera-controls touch-action="pan-y" src="../../shared-assets/models/Astronaut.glb" poster="../../assets/poster-astronaut.webp" tone-mapping="aces" shadow-intensity="1" alt="A 3D model of an astronaut.">
111111
<button class="hotspot" slot="hotspot-visor" data-position="0 1.75 0.35" data-normal="0 0 1"></button>
112112
<button class="hotspot" slot="hotspot-hand" data-position="-0.54 0.93 0.1" data-normal="-0.73 0.05 0.69">
113113
<div class="annotation">This hotspot disappears completely</div>
@@ -289,7 +289,7 @@ <h4><span class="font-medium">Show Dimensions. </span></h4>
289289
</p>
290290
<example-snippet stamp-to="dimensions" highlight-as="html">
291291
<template>
292-
<model-viewer id="dimension-demo" ar ar-modes="webxr" ar-scale="fixed" camera-orbit="-30deg auto auto" max-camera-orbit="auto 100deg auto" shadow-intensity="1" camera-controls touch-action="pan-y" src="../../assets/ShopifyModels/Chair.glb" tone-mapping="neutral" alt="A 3D model of an armchair.">
292+
<model-viewer id="dimension-demo" ar ar-modes="webxr" ar-scale="fixed" camera-orbit="-30deg auto auto" max-camera-orbit="auto 100deg auto" shadow-intensity="1" camera-controls touch-action="pan-y" src="../../assets/ShopifyModels/Chair.glb" alt="A 3D model of an armchair.">
293293
<button slot="hotspot-dot+X-Y+Z" class="dot" data-position="1 -1 1" data-normal="1 0 0"></button>
294294
<button slot="hotspot-dim+X-Y" class="dim" data-position="1 -1 0" data-normal="1 0 0"></button>
295295
<button slot="hotspot-dot+X-Y-Z" class="dot" data-position="1 -1 -1" data-normal="1 0 0"></button>
@@ -553,6 +553,7 @@ <h4><span class="font-medium">Camera Views. </span></h4>
553553
min-camera-orbit="auto auto 5%"
554554
touch-action="none"
555555
poster="../../assets/SketchfabModels/ThorAndTheMidgardSerpent.webp"
556+
tone-mapping="aces"
556557
ar
557558

558559
>

packages/modelviewer.dev/examples/augmentedreality/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h4>Customize a WebXR Augmented Reality session with HTML, CSS, and JS in Chrome
8080
</div>
8181
<example-snippet stamp-to="webXR" highlight-as="html">
8282
<template>
83-
<model-viewer src="../../assets/ShopifyModels/Chair.glb" poster="../../assets/ShopifyModels/Chair.webp" tone-mapping="neutral" shadow-intensity="1" ar camera-controls touch-action="pan-y" alt="A 3D model carousel">
83+
<model-viewer src="../../assets/ShopifyModels/Chair.glb" poster="../../assets/ShopifyModels/Chair.webp" shadow-intensity="1" ar camera-controls touch-action="pan-y" alt="A 3D model carousel">
8484

8585
<button slot="ar-button" id="ar-button">
8686
View in your space
@@ -412,7 +412,7 @@ <h4></h4>
412412
<template>
413413
<div class="demo" style="background: linear-gradient(#ffffff, #ada996); overflow-x: hidden;">
414414
<span style="position: absolute; text-align: center; font-size: 100px; line-height: 100px; left: 50%; transform: translateX(-50%);">Background<br>is visible<br>through<br>transparent<br>objects.</span>
415-
<model-viewer camera-controls touch-action="pan-y" src="../../shared-assets/models/glTF-Sample-Assets/Models/ToyCar/glTF-Binary/ToyCar.glb" tone-mapping="neutral" ar alt="A 3D transparency test" style="background-color: unset;"></model-viewer>
415+
<model-viewer camera-controls touch-action="pan-y" src="../../shared-assets/models/glTF-Sample-Assets/Models/ToyCar/glTF-Binary/ToyCar.glb" ar alt="A 3D transparency test" style="background-color: unset;"></model-viewer>
416416
</div>
417417
</template>
418418
</example-snippet>

packages/modelviewer.dev/examples/color.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ <h2>Achieving Color-Accurate Presentation with glTF</h2>
144144
<model-viewer
145145
src="../assets/ShopifyModels/GeoPlanter.glb"
146146
poster="../assets/ShopifyModels/GeoPlanter.webp"
147-
tone-mapping="neutral"
148147
shadow-intensity="1"
149148
camera-controls
150149
alt="3D model of a cactus"
@@ -413,7 +412,7 @@ <h3 id="photography">How does rendering compare to photography?</h3>
413412
<model-viewer
414413
id="tone-mapping"
415414
src="../assets/ShopifyModels/Mixer.glb"
416-
tone-mapping="neutral"
415+
417416
camera-controls
418417
alt="Tone mapping comparisons for different 3D models"
419418
>
@@ -603,7 +602,7 @@ <h3 id="takeaway">What's the takeaway?</h3>
603602
id="environments"
604603
src="../assets/ShopifyModels/Mixer.glb"
605604
skybox-image="../../shared-assets/environments/neutral.hdr"
606-
tone-mapping="neutral"
605+
607606
camera-controls
608607
alt="3D model of a blender"
609608
>

packages/modelviewer.dev/examples/lightingandenv/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h2 class="demo-title">Showing the difference between our two baked-in lighting
139139
</div>
140140
<example-snippet stamp-to="neutralLighting" highlight-as="html">
141141
<template>
142-
<model-viewer id="neutral-demo" tone-mapping="neutral" camera-controls touch-action="pan-y" auto-rotate alt="A 3D model of a kitchen mixer" src="../../assets/ShopifyModels/GeoPlanter.glb">
142+
<model-viewer id="neutral-demo" camera-controls touch-action="pan-y" auto-rotate alt="A 3D model of a kitchen mixer" src="../../assets/ShopifyModels/GeoPlanter.glb">
143143
<label for="neutral">Neutral Lighting: </label>
144144
<input id="neutral" type="checkbox" checked="true">
145145
</model-viewer>
@@ -166,14 +166,14 @@ <h2 class="demo-title">Showing the difference between our two baked-in lighting
166166
<div class="heading">
167167
<h2 class="demo-title">Comparing tone mapping</h2>
168168
<p>Tone mapping is the critical last stage of the rendering pipeline that controls the final look of your model. It is necessary because the reflections are often much brighter than a screen can reproduce, so they must be smoothly mapped into the sRGB range, ideally while avoiding clipping artifacts or hue shifts. The image sensor and processing on a digital camera performs a similar step. </p>
169-
<p>Khronos PBR Neutral is our new tone mapper, designed specifically for the color accuracy needs of e-commerce. It is guaranteed to avoid all hue shifts, has a relatively sharp rolloff in intensity, and a slower progression to white. This is designed to pass the widest range of base color values through unchanged to the screen, while preserving enough headroom for highlights to show well. Neutral will become our default in our next major release, v4.0.</p>
170-
<p>ACES is a film industry standard that is widely used in graphics and is and has been our default tone mapper. However, it produces serious hue shifts and extreme desaturation, making bright yellow and cyan unattainable under any lighting. See for yourself in this example.</p>
169+
<p>Khronos PBR Neutral is our new tone mapper, designed specifically for the color accuracy needs of e-commerce. It is guaranteed to avoid all hue shifts, has a relatively sharp rolloff in intensity, and a slower progression to white. This is designed to pass the widest range of base color values through unchanged to the screen, while preserving enough headroom for highlights to show well. Neutral is now our default as of v4.0.</p>
170+
<p>ACES is a film industry standard that is widely used in graphics and was our default tone mapper prior to v4.0. However, it produces serious hue shifts and extreme desaturation, making bright yellow and cyan unattainable under any lighting. See for yourself in this example.</p>
171171
<p>AgX is a relatively new tone mapper that is getting a lot of adoption in graphics. It has less hue shifting than ACES and may be a good option for matching existing artist workflows, but has the same drawback of significant desaturation. However, in more artistic scenes this can be beneficial since it allows for a slower intensity rolloff.</p>
172172
<p>For an apples-to-apples comparison of ACES to Neutral with custom lighting, set the Neutral exposure to 1 and the ACES exposure to 0.77 to account for ACES being artificially bright. This compensation is automatic for our built-in lighting.</p>
173173
</div>
174174
<example-snippet stamp-to="toneMapping" highlight-as="html">
175175
<template>
176-
<model-viewer id="tone-demo" tone-mapping="neutral" camera-controls touch-action="pan-y" auto-rotate alt="A 3D model of a kitchen mixer" src="../../assets/ShopifyModels/Mixer.glb">
176+
<model-viewer id="tone-demo" camera-controls touch-action="pan-y" auto-rotate alt="A 3D model of a kitchen mixer" src="../../assets/ShopifyModels/Mixer.glb">
177177
<p>Tone Mapping:</p>
178178
<select id="tone">
179179
<option value="neutral">Neutral</option>

packages/modelviewer.dev/examples/loading/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h4></h4>
5959
<example-snippet stamp-to="displayPoster" highlight-as="html">
6060

6161
<template>
62-
<model-viewer id="reveal" loading="eager" camera-controls touch-action="pan-y" auto-rotate poster="../../assets/poster-shishkebab.webp" src="../../shared-assets/models/shishkebab.glb" shadow-intensity="1" alt="A 3D model of a shishkebab"></model-viewer>
62+
<model-viewer id="reveal" loading="eager" camera-controls touch-action="pan-y" auto-rotate poster="../../assets/poster-shishkebab.webp" tone-mapping="aces" src="../../shared-assets/models/shishkebab.glb" shadow-intensity="1" alt="A 3D model of a shishkebab"></model-viewer>
6363
</template>
6464
</example-snippet>
6565
</div>
@@ -230,7 +230,7 @@ <h4>
230230
</div>
231231
<example-snippet stamp-to="dracoSupport" highlight-as="html">
232232
<template>
233-
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a boom box" src="../../shared-assets/models/glTF-Sample-Assets/Models/BoomBox/glTF-Draco/BoomBox.gltf" tone-mapping="neutral">
233+
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a boom box" src="../../shared-assets/models/glTF-Sample-Assets/Models/BoomBox/glTF-Draco/BoomBox.gltf">
234234
</model-viewer>
235235
</template>
236236
</example-snippet>
@@ -306,7 +306,7 @@ <h4>
306306
</div>
307307
<example-snippet stamp-to="ktx2Support" highlight-as="html">
308308
<template>
309-
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a fish" src="../../shared-assets/models/BarramundiFish.mixed.glb" tone-mapping="neutral">
309+
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a fish" src="../../shared-assets/models/BarramundiFish.mixed.glb">
310310
</model-viewer>
311311
</template>
312312
</example-snippet>
@@ -332,7 +332,7 @@ <h4>
332332
</div>
333333
<example-snippet stamp-to="meshoptSupport" highlight-as="html">
334334
<template>
335-
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a mechanical coffee mug contraption" src="../../shared-assets/models/coffeemat.glb" tone-mapping="neutral">
335+
<model-viewer camera-controls touch-action="pan-y" alt="A 3D model of a mechanical coffee mug contraption" src="../../shared-assets/models/coffeemat.glb">
336336
</model-viewer>
337337
</template>
338338
</example-snippet>
@@ -394,7 +394,7 @@ <h4>Our renderer tries to keep the frame rate between 38 and 60 frames per secon
394394
</div>
395395
<example-snippet stamp-to="renderScale" highlight-as="html">
396396
<template>
397-
<model-viewer id="scale" alt="A 3D model of a toy car" camera-controls touch-action="pan-y" auto-rotate src="../../shared-assets/models/glTF-Sample-Assets/Models/ToyCar/glTF-Binary/ToyCar.glb" tone-mapping="neutral" ar>
397+
<model-viewer id="scale" alt="A 3D model of a toy car" camera-controls touch-action="pan-y" auto-rotate src="../../shared-assets/models/glTF-Sample-Assets/Models/ToyCar/glTF-Binary/ToyCar.glb" ar>
398398
Reported DPR: <span id="reportedDpr"></span><br/>
399399
Rendered DPR: <span id="renderedDpr"></span><br/>
400400
Minimum DPR: <span id="minimumDpr"></span><br/>

packages/modelviewer.dev/examples/scenegraph/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h2 class="demo-title">Swap Model Variants</h2>
9494
</div>
9595
<example-snippet stamp-to="variants" highlight-as="html">
9696
<template>
97-
<model-viewer id="shoe" camera-controls touch-action="pan-y" src="../../shared-assets/models/glTF-Sample-Assets/Models/MaterialsVariantsShoe/glTF-Binary/MaterialsVariantsShoe.glb" tone-mapping="neutral" ar alt="A 3D model of a Shoe">
97+
<model-viewer id="shoe" camera-controls touch-action="pan-y" src="../../shared-assets/models/glTF-Sample-Assets/Models/MaterialsVariantsShoe/glTF-Binary/MaterialsVariantsShoe.glb" ar alt="A 3D model of a Shoe">
9898
<div class="controls">
9999
<div>Variant: <select id="variant"></select></div>
100100
</div>

0 commit comments

Comments
 (0)