You are on page 1of 58

1

Some)mes, we even do some pre2y advanced colorspace reasoning, i.e. gamma/ linear textures in CryEngine h2p://www.crytek.com/download/ AdvRTRend_crytek.ppt Some confusion s)ll persists I.e. Which spaces are linear and which have a gamma curve? sRGB->CIEXYZ, do you need to degamma? h2p://www.brucelindbloom.com/index.html? Eqn_RGB_XYZ_Matrix.html h2p://en.wikipedia.org/wiki/RGB_color_space Why sRGB is gamma 2.2? Does it really make sense today? What gamma does our eye need? Perceptual color spaces See CIELAB h2p://en.wikipedia.org/wiki/ Lab_color_space What color space does HDR live in? What does HDR really mean, for colors? sRGB is dened normalizing on the white point intensity h2p://blogs.msdn.com/b/billcrow/ archive/2007/10/25/hdr-and-color-spaces.aspx Anyhow

10

11

Ok, not true in all cases, for example, if we used a tonemapper with local adap)on (which, games dont really do), that would be a post-lter that cant be achieved with shaders in an LDR. Alpha blending also cant exactly match. Dynamic exposure wont have access to the exact same informa)on and so on. Dont take that too literally, my point is that you have to think what youre doing and why. For decades now, oine renderers were not working in linear space, nor HDR, and that didnt stop ar)sts from crea)ng perfectly photorealis)c images.

12

To me, the rst three are either irrelevant or easy to do in LDR, not that interes)ng Let me be clear here. With enough eort we can take some equa)ons, and parameters, and tweak them and tweak them un)l they look perfect, from all angles and situa)ons. As the complexity of the equa)ons and parameters and situa)ons grow, this tweaking work becomes unwieldy. For example, we can take our shaders, maybe they are outpumng a color and the highlights are clipped. We can apply to that color and these highlights some desatura)on. We dont know why, but its necessary to make the image not look like a nuclear explosion of colors. We can keep tweaking in this way, un)l it looks right from all angles, but at the end of the day, aner we blindly tweaked and hacked things without meaning, we should obtain exactly an approxima)on of the rules of physics and percep)on we know Physically based rendering lets us reason in a framework of certainty. This equa)on is a material, this is a light, this is energy, this is a color, this is how the eye sees things. Its s)ll very easy to forget whats important, to choose the right models, to miss some light or make mistakes. But we can compare the output with our reference, the reality, see our error, and understand where and why. Hopefully.

13

Image from Fallout. The errors are my own interpreta)on, maybe this image was ne both for the ar)sts, and was tone mapped right Is being physically based always be2er? Not really. With the right tools, the right ar)sts, and maybe in a game that is more constrained, a painterly, ar)s)c approach might very well be the way to go

14

*At least, for a game that strives for realism In a non physically-based, or be2er, physically-reasonable renderer, changing a variable onen requires global changes, as the scene was setup with en))es that are onen correlated and do not carry a par)cular meaning Shaders output a color, somehow

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

The idea of local TM operators is that loss of contrast at low spa)al frequencies is hard to perceive, thus we can compress there and get be2er detail (representa)on, range for contrast in the high frequencies). Local lters could be done tastefully, i.e. Bilateral lters, edge aware in games, righsully, we onen prefer to convey brightness over preserving detail anyways.

33

34

If the tone mapping is xed a-priory, we could tune in tone-mapped space directly ...things can get ugly if we need to render the same scene under dierent tone mappings, if we tuned for one. If we tune directly with an art directed tonemapping/colorgrading, the risk is that our scene wont be physically reasonable anymore. We might not be able to tone it again, to change our decisions. Easy example is of scenes tuned for NO tonemapping, the dynamic range is onen squished down by the ar)sts (to avoid clipping) in a way that wont ever look right if aner authoring we just decide to bolt-on some tonemapping operators

35

36

37

38

39

40

41

42

Simplify[D[1/(1 + Exp[-x*4]), x] /. x -> 0] Manipulate[ Plot[ Piecewise[{ {(1/(1 + Exp[-x*4])) * c + (0.5 + x)*(1 - c), x < 0}, {(1/(1 + Exp[-x*4])) * d + (0.5 + x)*(1 - d), x >= 0} }] /. {x -> (y - b)/a} , {y, -3, 3}, PlotRange -> {0, 1}], {{a, 1, "range"}, 0.1, 10}, {{b, 0, "center"}, -3, 3}, {{c, 1, "low curve"}, -5, 1}, {{d, 1, "hi curve"}, -5, 1}]

43

44

45

Why not using alterna)ve color spaces? HSL and similar perceptual models are built, by deni)on, to be able to do said decoupling. Old, ar)st oriented color spaces. Slow to convert Today: CIELAB, CIELUV Changing L in LAB does not alter color... Problem: S)ll dont work well with HDR ranges

46

47

48

49

In reality, we adapt to many condi)ons, i.e. white point, but you have to be aware of what we lose from HDR->LDR and what is s)ll working in our percep)on of an LDR image, and thus we dont need to simulate Its a very complicated ma2er that also depends on your monitor prole, the angle the monitor spawns in your view and so on Also, not all persons are the same, for example, vision changes quite signicantly with the age, i.e. pdf.aminer.org/000/346/554/ fast_tone_mapping_for_high_dynamic_range_images.pdf

50

Decoupling ligh)ng from texture is what bilateral TMO tries to achieve. The concept of intrinsic images see the reference

51

52

53

54

55

56

h2p://www.audioholics.com/tweaks/calibrate-your-system/hdmi-black-levels-xvycc- rgb h2p://en.wikipedia.org/wiki/XvYCC h2p://research.microson.com/en-us/UM/redmond/groups/IVM/hdview/ ColorExamples.htm

57

58

You might also like