@@ -135,6 +135,7 @@ <h2>Tone Mapping Considerations for Physically-Based Rendering</h2>
135
135
< a href ="#tradeoffs "> Tradeoffs</ a > < br />
136
136
< a href ="#needs "> The needs of e-commerce</ a > < br />
137
137
< a href ="#commerce "> Commerce tone mapper</ a > < br />
138
+ < a href ="#validation "> Validation</ a > < br />
138
139
< a href ="#white "> White point</ a > < br />
139
140
</ p >
140
141
@@ -252,7 +253,7 @@ <h3 id="purpose">The purpose of tone mapping</h3>
252
253
the level of ambient lighting around it, but this data is unlikely to be
253
254
available.</ p >
254
255
255
- < h3 id ="# tradeoffs "> Tradeoffs</ h3 >
256
+ < h3 id ="tradeoffs "> Tradeoffs</ h3 >
256
257
257
258
< p > The difficulty with compressing a nearly infinite HDR range down to sRGB
258
259
is the necessary loss of information. For the highlights to be discernable,
@@ -299,10 +300,10 @@ <h3 id="#tradeoffs">Tradeoffs</h3>
299
300
system to compensate for the loss of saturation, allowing the image to still
300
301
look good, instead of washed-out.</ p >
301
302
302
- < h3 id ="# needs "> The needs of e-commerce</ h3 >
303
+ < h3 id ="needs "> The needs of e-commerce</ h3 >
303
304
304
305
< p > Unfortunately, the needs of e-commerce are quite different than the needs
305
- of film or gaming. On a website, a 3D product model will side-by-side with
306
+ of film or gaming. On a website, a 3D product model will be side-by-side with
306
307
sRGB product photos, and a user may often compare the image on their screen
307
308
to a printed image in a catalogue or to the physical product they have
308
309
received. Of course it is exceedingly difficult to succeed in these
@@ -348,7 +349,7 @@ <h3 id="#needs">The needs of e-commerce</h3>
348
349
these situations, but there will be additional challenges beyond tone
349
350
mapping as well.</ p >
350
351
351
- < h3 id ="# commerce "> Commerce tone mapper</ h3 >
352
+ < h3 id ="commerce "> Commerce tone mapper</ h3 >
352
353
353
354
< p > The Commerce tone mapper is designed to be simple to implement, fast to
354
355
run, and faithfully reproduce color as much as possible while eliminating
@@ -375,7 +376,7 @@ <h3 id="#commerce">Commerce tone mapper</h3>
375
376
376
377
< p > Since tone mapping is about fitting into the sRGB cube, I intentionally
377
378
avoid any use of luminance weights, as the edges of the sRGB cube are not at
378
- all constant luminance. Instead I scale down colors by a simple multiplier,
379
+ all constant luminance. Instead I scale down colors by a scalar multiplier,
379
380
thus preserving hue and saturation while reducing brightness (there are many
380
381
definitions for these terms, so please bear with my imprecision). The
381
382
brightness metric I use is the maximum value of R, G, and B, and the goal is
@@ -386,10 +387,10 @@ <h3 id="#commerce">Commerce tone mapper</h3>
386
387
a single parameter: the value where we switch from the linear to the
387
388
nonlinear function. The purpose of the Commerce tone mapper is to be a
388
389
standard and thus without parameters, so I chose 0.8 after much testing.
389
- However, this is likely the most natural place to adjust the curve for HDR
390
- output rather than sRGB.</ p >
390
+ However, this is likely the most natural place to adjust the curve to HDR
391
+ output from sRGB.</ p >
391
392
392
- < p > Converting 0.8 to sRGB gives 231, so any baseColor with R, B , and B
393
+ < p > Converting 0.8 to sRGB gives 231, so any baseColor with R, G , and B
393
394
values below 231 will be faithfully reproduced under even, white lighting.
394
395
The compression reduces 255 to 243, so all highlights that would be clipped
395
396
end up mapped to the 243-255 range.</ p >
@@ -407,7 +408,7 @@ <h3 id="#commerce">Commerce tone mapper</h3>
407
408
only other parameter in this tone mapper controls the rate of desaturation,
408
409
which I chose as 0.15, which is significantly slower to approach its
409
410
asymptote than the compression function. This is what helps produce our
410
- smoother gradients and hide the aggressiveness of our compression. In some
411
+ smoother gradients and hide the aggressiveness of our compression. In a
411
412
sense I am replacing the lost brightness with desaturation, thus giving the
412
413
brain an alternate perceptual cue, which smoothly encodes several orders of
413
414
magnitude more brightness than is available in the output screen.</ p >
@@ -446,12 +447,14 @@ <h3 id="#commerce">Commerce tone mapper</h3>
446
447
< figcaption > Same as above, but with the input brightness in log scale.</ figcaption >
447
448
</ figure >
448
449
449
- < p > The following demo uses a test model based on a Macbeth color chart. For each color,
450
- there is a matte sphere, shiny dielectric sphere and an unlit sphere for
451
- baseColor comparison. Along the top is an additional row with saturated
452
- colors and shiny metallic spheres - this is useful for demonstrating the
453
- problems with Linear/Clamped tone mapping. Along the left and right are
454
- columns of shiny metals.</ p >
450
+ < p > The following demo uses a test model based on a Macbeth color chart. For
451
+ each color, there is a matte sphere, shiny dielectric sphere and an unlit
452
+ sphere for baseColor comparison. Along the top is an additional row with
453
+ saturated colors and shiny metallic spheres - this is useful for
454
+ demonstrating the problems with Linear/Clamped tone mapping - note the
455
+ extreme hue skews of the highlights. Along the left and right are columns of
456
+ shiny metals.</ p >
457
+
455
458
< p > Try the different tone mappers under both
456
459
neutral and outdoor lighting. This test is intentionally designed to show
457
460
off HDR artifacts.</ p >
@@ -491,7 +494,7 @@ <h3 id="#commerce">Commerce tone mapper</h3>
491
494
< figcaption > Tone mapper test demo.</ figcaption >
492
495
</ figure >
493
496
494
- < h3 id ="# validation "> Validation</ h3 >
497
+ < h3 id ="validation "> Validation</ h3 >
495
498
496
499
< p > The best end-to-end validation we have for color accuracy is to apply an
497
500
unrealistic, analytic lighting environment: a white furnace test, where the
@@ -517,25 +520,25 @@ <h3 id="#validation">Validation</h3>
517
520
shadow-intensity ="1 "
518
521
>
519
522
</ model-viewer >
520
- < figcaption > Commerce tone mapper validation.</ figcaption >
523
+ < figcaption > Commerce tone mapper white furnace validation.</ figcaption >
521
524
</ figure >
522
525
523
- < p > The first difference is from the Fresnel effect: on shiny materials, the
526
+ < p > The first difference is due to multi-scattering, which causes the
527
+ dark-colored matte (front) spheres to be slightly darker than their unlit
528
+ comparisons. This is intentional, as matte materials are rough, thus
529
+ forming microscopic cavities that cause slight ambient occlusion and allow
530
+ dark materials more light bounces to absorb energy. Accurate PBR renderers
531
+ include this effect because a single material will in fact become brighter
532
+ as it is polished.</ p >
533
+
534
+ < p > The second difference is from the Fresnel effect: on shiny materials, the
524
535
reflection loses material color near grazing angles. This is a physical
525
536
reality and causes the white halos on the edges of the shiny (back) spheres.
526
537
If you turn the model until the unlit spheres overlap the middle of the
527
538
shiny spheres, you'll see that the color match is exact at normal (center)
528
539
reflection.</ p >
529
540
530
- < p > The second effect is multi-scattering, which causes the dark-colored
531
- matte (front) spheres to be slightly darker than their unlit comparisons.
532
- This is also intentional, as matte materials are rough, thus forming
533
- microscopic cavities that cause slight ambient occlusion and allow dark
534
- materials more light bounces to absorb energy. Accurate PBR renderers
535
- include this effect because a single material will in fact become brighter
536
- as it is polished.</ p >
537
-
538
- < h3 id ="#white "> White point</ h3 >
541
+ < h3 id ="white "> White point</ h3 >
539
542
540
543
< p > The tl;dr of this section is that you can safely skip it. It is a
541
544
discussion of the difference between physically correct and practical
0 commit comments