11.07.2015 Views

mental ray Architectural and Design Visualization Shader Library

mental ray Architectural and Design Visualization Shader Library

mental ray Architectural and Design Visualization Shader Library

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

88 4 Camera- <strong>and</strong> Exposure EffectsAlso, both of the supplied tone mappers include a gamma term. It is important to know ifone is already applying a gamma correction elsewhere in the imaging pipeline (in an imageviewer, in compositing, etc.), <strong>and</strong> if so, set it to 1.0 in these shaders. If one is not applyinggamma correction anywhere but simply displaying the image directly on screen with a viewerthat does not apply it’s own gamma, one should most likely use the gamma in these shaders,set to a value between 1.8 <strong>and</strong> 2.4.4.1.1 The “Simple” Tone Mapper4.1.1.1 mia exposure simpledeclare shader "mia_exposure_simple" (scalar "pedestal" default 0.0,scalar "gain" default 1.0,scalar "knee" default 0.5,scalar "compression" default 2.0,scalar "gamma" default 2.2,color texture "preview",boolean "use_preview")version 1apply lens, outputend declareThe operation of this tone mapper is very simple. It does not refer to real physical luminancevalues in any way. It simply takes the high dynamic range color <strong>and</strong> perform these operationsin order:• pedestal is added to the color.• The color components are then multiplied with gain.• The resulting colors are checked if they are above the knee value.• If they are, they are “squashed” by the compression ratio compression• Finally, gamma correction with gamma is performed.That’s the theory. What is the practical use of these parameters?Changing pedestal equates to tweaking the “black level”. A positive value will add somelight so even the blackest black will become slightly g<strong>ray</strong>. A negative value will subtract somelight <strong>and</strong> allows “crushing the blacks” for a more contrasty artistic effect.gain is the “brightness knob”. This is the main point where the high dynamic range valuesare converted to low dynamic range values. For example: if one knows the approximate range

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!