RIS
|
Introduction
This tutorial shows how to use the
|
Step 1 - Create an Instance of PxrSurface
Create a new document and save it
in the HOME_DIR |_/archives |_/geo |_/lights |_/materials/ |_ TimesSq.rib
Open the document and choose
Cutter will insert a very long rib statement into the document. Most of
the default values of the parameters of |
Bxdf "PxrSurface" "PxrSurface1" "float diffuseGain" [1.0] "color diffuseColor" [0.18 0.18 0.18] # other inputs deleted |
Step 2 - Assign a Texture Input to PxrSurface.diffuseColor
Move the text cursor to the beginning of the document and choose
The archive will now have the following rib statements. Again, for brevity the parameters that will not be changed have been deleted. |
# txmake -mode periodic ../tiffs/name.tif ../textures/name.tex Pattern "PxrTexture" "PxrTexture1" "string filename" [""] "int linearize" [0] # Examples manifold connection #"reference struct manifold" ["PxrManifold2D1:result"] #"reference struct manifold" ["PxrManifold3D1:result"] # "PxrTexture1:resultRGB" uses->|color|vector|normal|point| # "PxrTexture1:resultR" uses->|float| # "PxrTexture1:resultG" uses->|float| # "PxrTexture1:resultB" uses->|float| # "PxrTexture1:resultA" uses->|float| Bxdf "PxrSurface" "PxrSurface1" "float diffuseGain" [1.0] "color diffuseColor" [0.18 0.18 0.18] # other inputs deleted |
Source images must be converted to a special texture
file format before they can be used for texture mapping.
Download times_sq.tif and copy it to the HOME_DIR |_tiffs/times_sq.tif Edit this comment so that it refers to the source image. # txmake -mode periodic ../tiffs/times_sq.tif ../textures/times_sq.tex
Select the entire line of commented text and use the keyboard shortcut Alt + e,
Control + e or Apple + e. Cutter will execute Pixars
The # "PxrTexture1:resultRGB" uses->|color|vector|normal|point| Change the code as shown below. # txmake -mode periodic ../tiffs/times_sq.tif ../textures/times_sq.tex Pattern "PxrTexture" "PxrTexture1" "string filename" ["times_sq.tex"] ## <-- note the use of the texture map "int linearize" [1] ## <-- note change to 1 # Examples manifold connection #"reference struct manifold" ["PxrManifold2D1:result"] # "PxrTexture1:resultRGB" uses->|color|vector|normal|point| Bxdf "PxrSurface" "PxrSurface1" "float diffuseGain" [1.0] "reference color diffuseColor" ["PxrTexture1:resultRGB"] # other inputs deleted
In particular, notice the use of the keyword |
Step 3 - Assign a Manifold
The scale and offset of the texture map can be controlled with an instance of
the |
TimesSq.rib
|
Step 4 - using ReadArchiveThe following rib statement placed immediately before the geometry to be texture mapped. ReadArchive "materials/TimesSq.rib" |
© 2002- Malcolm Kesson. All rights reserved.