Bedroom: Mental Ray using MDL

25 Nov 2014

After adjusting the export_multi.py script to export light emitting objects and a sun/sky system, we can render the bedroom scene with mental ray using MDL materials (see NVIDIA’s technical documentation about their Material Definition Language):

Bedroom rendered by mental ray (using MDL).

Unfortunately the scenes are getting too big for the repository, so I provide download links in various (renderer specific) file formats here.

Let’s just have a quick look at parts of the resulting bedroom.mi file (mental ray specific scene description):

...
# sun
shader "sun_sky" "mdl::base::sun_and_sky" (
  "on" on,
  "multiplier" 0.025,
  "rgb_unit_conversion" 0.00666667 0.00666667 0.00666667,
...
  "physically_scaled_sun" on
)
...

The intensity of the sun light can be controlled by adjusting the rgb_unit_conversion color parameter.

...
# Lamp_Bulb_mat
shader "Lamp_Bulb_mat_mat" "physical_light" (
  "color" 50000.0 50000.0 50000.0
)
...

The intensity of the light bulb is dependent on the color of the physical_light shader. Later this light emitter will be replaced by it’s MDL counterpart, but for now that’s how it works.

Credits