RenderMan For Artists #01
Wanho Choi
(wanochoi.com)
RenderMan Architecture
The Road Ahead
•
Learning RenderMan is not easy or quick. However, it is not rocket science either.
-We will explore …
•
The RenderMan Shading Language Guide
– Rudy Cortes and Saty Raghavachary
•
Rendering for Beginners: Image synthesis using RenderMan
– Saty Raghavachary
•
Advanced RenderMan: Creating CGI for Motion Pictures
– Anthony A. Apodaca and Larry Gritz
•
Essential RenderMan
– Ian Stephenson
•
The RenderMan Companion: A Programmer's Guide to Realistic Computer Graphics
– Steve Upstill
•
SIGGRAPH course notes
– 1992, 1995, 2000, 2001, 2002, 2003, 2006
•
pdf files from web
•
Etc.
Rendering
•
What is rendering?
–
A series of works for determining the color and opacity value of a pixel
–
Scene (objects, lights, camera in 3D) Image (2D)
•
Rendering algorithms
–
Scanline
–
Ray tracing
–
Radiosity
–
etc.
•
Commercial renderers
–
RenderMan
–
Mental Ray
–
V-Ray
–
POV-Ray
–
FurryBall
–
etc.
Ray Tracing Algorithm
•
A technique for generating an image by tracing the path of light through
RenderMan
•
A standard technical specification
created by Pixar for 3D scene description
– RiSpec: RenderMan Interface Specification
•
There are some
RenderMan compliant renderers
.
– PRMan, AIR, Pixie, 3Delight, Aqsis, RenderDotC, BMRT, Mantra, etc. – It must meet all of the standard requirements laid out in the RiSpec.
•
PRMan
: Pixar's PhotoRealistic RenderMan
®renderer
– Usually, RenderMan = PRMan
– It is just an API(Application Programming Interface) to communicate with renderers.
Maya 3DS Max SoftImage|XSI Houdini Text Editor RenderMan Interface PRMan AIR 3Delight Aqsis RenderDotC image Modeling
Very Simple Example
Display "result.jpg" "file" "rgb" Projection "perspective" "fov" 30 WorldBegin Translate 0 0 5 Sphere 1 -1 1 360 WorldEnd .rib
1-1_minimal_rib
Two Main Parts of RenderMan
•
3D scene description language
•
Programmable shading language
Display “sphere.tiff” “file” “rgb” Projection “perspective”
WorldBegin Translate 0 0 2
Surface “myShader” “color surfaceColor” [1 0 0]
Sphere 1 -1 1 360 WorldEnd
.rib
surface myShader(
color surfaceColor = color(1,1,1); color surfaceOpacity = color(1,1,1); ) { Oi = surfaceOpacity; Ci = Oi * surfaceColor; } .sl
1-2_minimal_sl
How to Render Scene & Compile Shader
.rib .sl image•
Renderer
•
Shader compiler
PRMan Pixie 3Delight Aqsis RenderDotC prman rndr renderdl aqsis renderdc BMRT rendrib PRMan Pixie 3Delight Aqsis RenderDotC shader sdrc shaderdl aqsl shaderdc BMRT slc PRMan Pixie 3Delight Aqsis RenderDotC .slo .sdr .sdl .slx .dll, .so BMRT .slcRenderMan Packages
• RAT (RenderMan Artist Tools)– MTOR (Maya To RenderMan): Maya plug-in for translating Maya scene into RenderMan – Slim: the complete solution for shader management and creation using GUI
– Alfred: the script processing system tool for network rendering
– It (Image Tools): viewer, multiple images management
• RFM (RenderMan For Maya)
– The latest (and greatest) bridges between Maya and RenderMan
– A plug-in to Maya and renders to the RenderMan embedded renderer (entry-level product)
• RFM Pro (RenderMan For Maya Pro)
– .rib is exposed to the user
– allows renders to be dispatched to ProServer render nodes.
• RMS (RenderMan Studio)
– RFM Pro
– Slim
– Alfred
– It
• RPS (RenderMan Pro Server)
– Standalone renderer + Alfred, It, ….
– RPS will turn any server or artist desktop into a rendering machine.
REYES
•
“
Render Everything You Ever Saw
”
•
Loren Carpenter
’s favorite spots on the California coastline,
Point Reyes
.
•
Invented at
Lucasfilm
(later Pixar) by Cook et al.
The Road to Point Reyes
The Founders of REYES Algorithm
•
The Reyes Image Rendering Architecture
– Robert L. Cook, Loren Carpenter, and Edwin Catmull – Computer Graphics, Vol. 21, No. 4, July 1987
REYES Goal (1986)
Item
Spec.
Micropolygons (area=¼ pixel) 80,000,000
Pixels 3000 x 1667 (5 MP) Depth complexity 4
Samples per pixel 16
Geometric primitives 150,000 Micropolygons per grid 100 Shading flops per micropolygon 300 Textures per primitive 6
Total number of textures 100 (1 MB/textures) Render time ≤ 2 minutes / 1 frame
REYES Algorithm
•
A geometric pipeline, similar to those modern-day hardware graphics pipeline
•
A series of converting process from a primitive into a finer and more detailed version.
– Splitting, dicing, busting, sampling
•
Every geometry is diced up into grids of
micropolygons
.
•
Micropolygon
– A quadrilateral facet
– Approximately pixel-sized, but controllable by user – Input data structure into the shading stage
– Four vertices get shaded and eventually contribute to final pixel colors & opacities
•
Grid
– A collection of micropolygons specified by grid size
– Once micropolygon grids are shaded, the grids get busted into individual micropolygons containing colors, opacities at the corners.
•
Pros.
– Uniformity in the shading pipeline
– Future-proof when new geometry types come to
주사위[체크] 무늬로 만들다
REYES Rendering Algorithm
patch primitive sub-patches split
a sub-patch micropolygon grid four corners of a micropolygon dice
micropolygon grid micropolygonsindividual bust
REYES Rendering Pipeline
RIBParsing Clipping primitives
Dicing into micropolygon grids Too
large? Splitting
Shading grid vertices Busting grid Clipping micropolygons
Outside?
Outside?
Sampling at subpixel locations Collapsing visible point lists Blending sample colors, opacities
Result image Discard Discard Yes Yes No No No Yes shaders textures
Grids and Micropolygons
surface gmRandColor() {
color Cgrid = randomgrid(); float mpc = 0.5 + 0.5*random(); Oi = Os;
Ci = Cs * Os * mpc * Cgrid; }
.sl
Display "result.tiff" "file" "rgb" Projection "perspective" "fov" [30] ShadingRate 15.0 Translate -0.4 0.15 3 Rotate -20 1 0 0 Rotate -40 0 1 0 WorldBegin Surface “gmRandColor" ReadArchive “Gumbo.dat" WorldEnd .rib
1-3_grid_mcpg
Controls
•
Trade-off
between …
–
Render
time
,
quality
, and
memory
•
Memory and performance related controls
–
Bucket size
–
Grid size
•
Image quality related controls
–
Shading rate
–
Pixel samples
Controls: Bucket Size
•
Bucket
– A rectangular pixel block(=tile) which get processed(=rendered) by one by one – Default: 16x16 pixels
•
Why needed?
– To ensure that the memory requirements stay as low as possible
– Imagine that when the REYES algorithm was designed, machines had less than 1MB of RAM but people wanted to render 2k frames with complex geometry diced into millions of µ-polygons and motion blur without going into swap.
•
Guidance
– Make the bucket size as large as possible: Usually, 16x16 or 32x32 or 64x64
•
How to control
More on Bucketing
•
Bucket
– A small rectangular pixel region divided from the image (default: 16x16 pixels) – A unit processed one by one in the rendering procedure
– One bucket processed one at a time
Primitive A will be diced, shaded, and sampled in the current bucket.
Primitive B needs to be split, and half will return to the current bucket while half will be handled in a future bucket.
Primitive C is in the current bucket because its bounding box touches it, but once split, both child primitives will fall into future buckets.
Primitive D will be diced and shaded in the current
bucket, but some of the micropolygons generated will be held for sampling until the next bucket is processed.
Eventually, there are no more primitives in the current bucket’s list.
They all have either been sampled or transferred to future buckets.
Smaller bucket size, more memory efficiency, but more overhead.
Controls: Shading Rate
•
Maximum area of micropolygons in pixels
–
Shading rate = 1: the size of the largest micropolygon ≒ 1 pixel
–
With larger shading rate
• Fast & low memory, but low image quality
–
With small shading rate
• Slow & large memory, but high image quality
•
Guidance
–
1.0 : Mid-high level of detail rendering
–
0.25 ~ 0.5: Production-quality rendering
–
5.0 : Fast preview rendering
•
How to control
Shading Rate Examples: 0.1
Shading Rate Examples: 1.0
Shading Rate Examples: 10.0
Shading Rate Examples: 100.0
Shading Rate Examples: 1000.0
Shading Rate Examples: 10000.0
Shading Rate Examples: 100000.0
Controls: Grid Size
•
The maximum number of micropolygons in a grid
–
Optimal GridSize = ( BucketWidth × BucketHeight ) ÷ ShadingRate
•
All micropolygons in a grid are shaded at once
–
One grid at a time, not one micropolygon at a time
•
It is affected by “Bucket Size” and “Shading Rate”.
–
“Grid Size” is strongly related to “Bucket Size”.
•
How to control
–
Ex)
Option “limits” “gridsize” [1024]
Today’s Key Words
•
REYES
•
RiSpec
•
PRMan
•
RIB
•
Shader
•
Bucket
•
Grid
•
Micropolygon
•
Shading rate
References
• Cook, Robert L., Loren Carpenter, Edwin Catmull, The Reyes Image Rendering Architecture, SIGGRAPH 87.
• Saty Raghavachary, Rendering for Beginners: Image synthesis using RenderMan, Focal Press, 2004
• Rudy Cortes, Saty Raghavachary, The RenderMan Shading Language Guide, Thomson Course Technology, 2007 • Ian Stephenson, Essential RenderMan Fast, Springer, 2003
• Anthony A. Apodaca, Larry Gritz, Advanced RenderMan: Creating CGI for Motion Pictures, Morgan Kaufmann, 1999
• PRMan: http://www.pixar.com • 3Delight: http://www.3delight.com • Air: http://www.sitexgraphics.com • Aqsis: http://aqsis.org • Pixie: http://www.renderpixie.com • RenderDotC: http://www.dotcsw.com • http://www.ugrad.cs.ubc.ca/~cs426/426-fall-2005/sept26-cs426-slides.pdf • http://graphics.stanford.edu/courses/cs448a-01-fall/lectures/lecture16/renderman.2up.pdf • http://www.graphicslive.co.kr/data/2008/03/0803_tech.pdf • http://www.dctsystems.co.uk/RenderMan/rmanBasics.html • http://en.wikipedia.org/wiki/Ray_tracing_(graphics) • http://www.k-3d.org/wiki/RenderMan_Controls