| RIS | 
| IntroductionThis tutorial shows how to apply a displacement to an object. It is assumed the reader has followed the instructions presented in the tutorial "RIS: Introduction to RIS Shading". The jack_scene.rib from that tutorial will be used in this demonstration. 
			 | 
| Step 1 - Create an Instance of PxrDisplace
			Save an empty rib archive
			named      HOME_DIR
            |_/archives
                      |_/geo
                      |_/lights
                      |_/materials/
                                 |_ Ridges.rib			
			Open the archive document and choose  
			 Cutter will insert the following rib statements into the document. | 
| Attribute "displacementbound" "float sphere" [1]
Displace "PxrDisplace" "PxrDisplace1"
        "int enabled" [1]
        "float dispAmount" [1.0]
        "float dispScalar" [0.0]
        "vector dispVector" [0.0 0.0 0.0]
        "vector modelDispVector" [0.0 0.0 0.0] | 
| Step 2 - Assign an Input to the Displacement
			Move the text cursor to the beginning of the document and choose  
			 The archive will now have the following rib statements. | 
| 
Pattern "PxrWorley" "PxrWorley1"
        "int surfacePosition" [0]
        "float frequency" [4.0]
        "int distancemetric" [0]
        "float jitter" [0.75]
        "float c1" [0.8]
        "float c2" [-0.2]
        "float minkowskiExponent" [4.0]
        "int shape" [0]
        "int clamp" [1]
        "int invert" [0]
        "float randomScale" [0.]
        "float randomScaleCenter" [0.]
        # Examples manifold connection
        #"reference struct manifold" ["PxrManifold2D1:result"]
        #"reference struct manifold" ["PxrManifold3D1:result"]
  
        # "PxrWorley1:resultF"    uses->|float| 
        # "PxrWorley1:resultRGB"  uses->|color| 
    
Attribute "displacementbound" "float sphere" [1]
Displace "PxrDisplace" "PxrDisplace1"
        "int enabled" [1]
        "float dispAmount" [1.0]
        "float dispScalar" [0.0]
        "vector dispVector" [0.0 0.0 0.0]
        "vector modelDispVector" [0.0 0.0 0.0] | 
| 
			The  # "PxrWorley1:resultF" uses->|float| 
			This will be used to "drive" PxrDisplace's       "float dispScalar" [0.0]
to
    "reference float dispScalar" ["PxrWorley1:resultF"]
			Note the use the keyword  | 
| Step 3 - Using ReadArchiveAt line 39 in jack_scene.rib add the following rib statement ReadArchive "materials/Ridges.rib" Render the rib. 
			 | 
| Accessing the Documentation for a Rib StatementWith the alt key down, double clicking on the name of a Pattern, Bxdf or any other rib statement will automatically open the Pixar documentation for the item. | 
© 2002- Malcolm Kesson. All rights reserved.