RIS
Shading - DomeLight


return to main index



Introduction

This tutorial introduces the use of Pixar's PxrDomeLight light.



Figure 1
With and without image based HDR lighting


The image used in this tutorial (WinterForest_Ref.hdr), was downloaded from,
    http://hdrlabs.com/sibl/archive.html




Save your .hdr image in the "tiffs" folder.

    HOME_DIR/
            |_tiffs/yourHDR.hdr


Step 1 - the basic scene

Save the rib shown in listing 1 as hdr_jack.rib in the "ribs" folder.

    HOME_DIR/
            |_ribs/hdr_jack.rib



Listing 1 (hdr_jack.rib)


Option "ribparse" "string varsubst" ["$"]
IfBegin "!defined(RMSTREE)"
    Option "user" "string RMSTREE" ["/Applications/Pixar/RenderManForMaya-21.0-maya2016"]
IfEnd
Option "searchpath" "shader"    ["../../maya/projects/RfM_osl:@"]
Option "searchpath" "rixplugin" ["${RMSTREE}/lib/shaders:@"]
Option "searchpath" "texture"   ["../textures:@"]
Option "searchpath" "archive"   ["../archives:Cutter_Help/templates/Rib:custom_templates/Rib"]
#Option "statistics" "endofframe" [1]
  
Hider "raytrace" "int incremental" [1] "int minsamples" [0] "int maxsamples" [128] "float darkfalloff" [0.025]
Integrator "PxrPathTracer" "PxrPathTracer" "int maxPathLength" [10] "int allowCaustics" [0]
PixelVariance 0.005
  
Format 550 300 1
Display "untitled" "it" "rgba"
Projection "perspective" "fov" [20]
  
Translate  1.1 -0.1 15
Rotate -30 1 0 0
Rotate 35  0 1 0
Scale 1 1 -1
#Imager "background" "color color" [1 1 1]
WorldBegin
    ReadArchive "lights/env_hdr.rib"
    AttributeBegin
        Scale 3 3 3
        ReadArchive "materials/Chrome.rib"
        ReadArchive "geo/jack.rib"
    AttributeEnd
    AttributeBegin
        Scale 50 1 50
        ReadArchive "materials/ThinFilm.rib"
        Polygon "P" [-0.5 0 -0.5  -0.5 0 0.5  0.5 0 0.5  0.5 0 -0.5]
                "st" [0 0  0 1  1 1  1 0]
    AttributeEnd
WorldEnd


Because the env_hdri.rib archive has not yet been created the render will generate the following error - it can be ignored.

    R12001 {ERROR}   File lights/env_hdri.rib cannot be opened by RiReadArchive. 
    (System Error: No such file or directory)

Step 2 - create a lighting archive rib file

Create a new document and save it as env_hdr.rib in the archives/lights/ directory.

    HOME_DIR/
            |_arhives/lights/env_hdr.rib

Use the Plugins->Lights menu item to insert the PxrDomeLight rib statement into the archive.



Figure 2


Edit the commented "txmake" line (listing 2). Select the entire line of text and use the keyboard shortcut Control+e, Alt+e or Apple+e to execute the txmake command. After a short pause the Process Monitor window should report,
    PROCESS COMPLETED.
Edit line 11 of the archive so that the lightColorMap parameter uses your converted env texture.


Listing 2 (env_hdr.rib)


AttributeBegin
    # txmake -envlatl  ../tiffs/WinterForest_Ref.hdr ../textures/WinterForest_Ref.env.tex
    Attribute "visibility" "int indirect" [0] "int transmission" [0]
    Attribute "visibility" "int camera" [0]
    Rotate 0 0 1 0
    Light "PxrDomeLight" "PxrDomeLight1"
        "float intensity" [1.0]
        "float exposure" [0]
        "color lightColor" [1 1 1]
        "string lightColorMap" ["../textures/WinterForest_Ref.env.tex"]
AttributeEnd


Step 3 - render the beauty pass rib


Figure 3











© 2002- Malcolm Kesson. All rights reserved.