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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.2 Environment Blur 105replaced by the incoming vector, interpreted in the aforementioned coordinate space. Equallyfor output, an “add” mode implies that the shader returns a perturbation vector intended tobe added to the current normal, <strong>and</strong> “set” mode implies that it returns a whole normal vector.In neither case does the shader actually modify the current normal by itself.5.2 Environment Blur5.2.1 <strong>Shader</strong> Functionality <strong>and</strong> ParametersThe mia envblur shader works by accepting some other environment shader as input, whichwould usually be a shader that performs an environment lookup in an HDRI environmentmap. When the render starts, it performs a one-time setup <strong>and</strong> rasterizes the result of thisenvironment shader in a special format into an internal pyramidal filter structure.Then, when rendering proceeds, the shader can perform an extremely efficient blurringoperation in this environment map in way that looks very similar to shooting an extremelylarge amount of glossy reflection <strong>ray</strong>s into it; i.e. it yields a perfectly smooth result - quickly.declare shader "mia_envblur" (shader "environment",scalar "blur" default 0.0,boolean "mia_material_blur" default on,integer "resolution" default 200)version 1apply environment, textureend declareenvironment is the actual environment shader looked up by this shader.specified, the global camera environment is used.If this is notblur is the amount of blur (range 0.0 to 1.0) applied on the image. If this is 0.0, the internalbitmap is bypassed <strong>and</strong> the environment shader is looked up directly, as if the mia envblurshader was not there.The blur amount can be automatically calculated setting mia material blur to on. Anyreflective environment lookup performed by mia material will cause the appropriate blur inmia envblur. Leave blur at 0.0 in this case. This feature is described in more detail on page108.resolution is the resolution of the internal pyramidal data structure used for the filtering.The default value of 200 means that a map of 200 x 200 samples are taken <strong>and</strong> stored,for subsequent filtering. This should be set high enough to resolve the smallest feature inthe environment map. 200 is generally enough for any still image - animations need higherresolutions (1000).

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

Saved successfully!

Ooh no, something went wrong!