RenderMan for Artist 01 – RenderMan Architecture

전체 글

(1)

RenderMan For Artists #01

Wanho Choi

(wanochoi.com)

RenderMan Architecture

(2)

The Road Ahead

Learning RenderMan is not easy or quick. However, it is not rocket science either.

(3)

-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.

(4)

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.

(5)

Ray Tracing Algorithm

A technique for generating an image by tracing the path of light through

(6)

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

(7)

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

(8)

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

(9)

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 .slc

(10)

RenderMan Packages

RAT (RenderMan Artist Tools)

MTOR (Maya To RenderMan): Maya plug-in for translating Maya scene into RenderManSlim: 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.

(11)

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

(12)

The Founders of REYES Algorithm

The Reyes Image Rendering Architecture

Robert L. Cook, Loren Carpenter, and Edwin CatmullComputer Graphics, Vol. 21, No. 4, July 1987

(13)

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

(14)

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 userInput 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

주사위[체크] 무늬로 만들다

(15)
(16)

REYES Rendering Algorithm

patch primitive sub-patches split

a sub-patch micropolygon grid four corners of a micropolygon dice

micropolygon grid micropolygonsindividual bust

(17)

REYES Rendering Pipeline

RIB

Parsing 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

(18)

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

(19)

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

(20)

Controls: Bucket Size

Bucket

A rectangular pixel block(=tile) which get processed(=rendered) by one by oneDefault: 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

(21)
(22)

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.

(23)

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

(24)
(25)

Shading Rate Examples: 0.1

(26)

Shading Rate Examples: 1.0

(27)

Shading Rate Examples: 10.0

(28)

Shading Rate Examples: 100.0

(29)

Shading Rate Examples: 1000.0

(30)

Shading Rate Examples: 10000.0

(31)

Shading Rate Examples: 100000.0

(32)

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]

(33)
(34)

Today’s Key Words

REYES

RiSpec

PRMan

RIB

Shader

Bucket

Grid

Micropolygon

Shading rate

(35)

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, 2007Ian 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.com3Delight: http://www.3delight.comAir: http://www.sitexgraphics.comAqsis: http://aqsis.orgPixie: http://www.renderpixie.comRenderDotC: http://www.dotcsw.comhttp://www.ugrad.cs.ubc.ca/~cs426/426-fall-2005/sept26-cs426-slides.pdfhttp://graphics.stanford.edu/courses/cs448a-01-fall/lectures/lecture16/renderman.2up.pdfhttp://www.graphicslive.co.kr/data/2008/03/0803_tech.pdfhttp://www.dctsystems.co.uk/RenderMan/rmanBasics.htmlhttp://en.wikipedia.org/wiki/Ray_tracing_(graphics)http://www.k-3d.org/wiki/RenderMan_Controls

수치

Updating...

참조

Updating...

관련 주제 :