REYES micropolygons Jordi Roca Monfort 200207 Introduction Render

  • Slides: 42
Download presentation
REYES micropolygons Jordi Roca Monfort 20/02/07

REYES micropolygons Jordi Roca Monfort 20/02/07

Introduction

Introduction

Render. Man Specification n Render. Man Interface Specification: n n Pixar Animation Studios (1988)

Render. Man Specification n Render. Man Interface Specification: n n Pixar Animation Studios (1988) Renderman Shading Language Allows specify high-level geometric primitives, (like quadrics or bicubic) Comparing with Open. GL spec: n n Both stack-based state machine with “immediate” rendering of primitives It is possible to implement either API in terms of the other

Render. Man Spec Implementation n A “renderer” is “Render. Man-compilant” if: n n n

Render. Man Spec Implementation n A “renderer” is “Render. Man-compilant” if: n n n Implements Minimum requeriments and optionally some advanced capabilities (see the paper) Render. Man-compilant renderers: n n n n 3 Delight (REYES) AIR Aqsis (REYES) Blue Mon Rendering Tools jr. Man (REYES) Pixie (REYES) Photo. Realistic Render. Man (REYES)

REYES: Renders Everything You Ever Saw n n A software architecture/algorithm to implement RMan

REYES: Renders Everything You Ever Saw n n A software architecture/algorithm to implement RMan Spec. Strong points : n n n Fast render of scenes with vast visual complexity. (3’’/frame or 2 hours movie at 24 fps taking a year) Low-memory and resource usage regardless of the scene complexity. Weak points : n Raytracing not supported efficiently. n Unpredictable ray direction causes model & texture page trashing (for complex scenes)

Render. Man Geometric primitives n n n Surfaces, Points, Curves (linear, cubic) Polygons, Polygonal

Render. Man Geometric primitives n n n Surfaces, Points, Curves (linear, cubic) Polygons, Polygonal meshes Subdivision Surfaces Patches Quadrics (Spheres, Cylinders, Cones, Tori, Hyperboloids, Paraboloids, Disks) Blobbies Constructive Solid Geometry (CSG) Procedurals Instancing Reference geometry Handedness, sides

Render. Man Geometric primitives

Render. Man Geometric primitives

Curves n n Parameters: Some control points and a “t” domain Expression: C(t) =

Curves n n Parameters: Some control points and a “t” domain Expression: C(t) = f [ P 0, P 1, . . , Pn , t ]

n Parameters: n n n Patches Mesh of control points U and V domains

n Parameters: n n n Patches Mesh of control points U and V domains Expression: S(u, v) = f[ P 00, P 01, . . , Pnm , u, v ]

Subdivision surfaces n Widely used implementation: the Catmull-Clark algorithm.

Subdivision surfaces n Widely used implementation: the Catmull-Clark algorithm.

Quadrics n n Ri. Cone(height, radius, thetamax, parameterlist) Ri. Cylinder(radius, zmin, zmax, thetamax, parameterlist)

Quadrics n n Ri. Cone(height, radius, thetamax, parameterlist) Ri. Cylinder(radius, zmin, zmax, thetamax, parameterlist) Ri. Sphere (radius, zmin, zmax, thetamax, parameterlist) Ri. Paraboloid(rmax, zmin, zmax, thetamax, parameterlist)

Procedural Geometry n n n A set of parametrizable algorithms generate, on-demand, irregular geometry

Procedural Geometry n n n A set of parametrizable algorithms generate, on-demand, irregular geometry at diferent LODs Example Fractals 2 D: The same algorithm/pattern is repeated at ever smaller scales. The 3 D model only stores the algorithms and input parameters.

Blobbies n n A Particle system specially suitable for liquids like water and mercury.

Blobbies n n A Particle system specially suitable for liquids like water and mercury. Particle: primitives with “physical” properties: n n Position, Velocity, Colour, Lifetime, Mass, … Particle system algorithm: for each video frame { generate new particles remove old particles for each particle { resolve forces by vector addition calculate a, v, x update other particle properties render particle } }

Constructive Solid Geometry (CSG) Ri. Solid. Begin("difference"); Ri. Solid. Begin("primitive"); Ri. Sphere(1. 0, -1.

Constructive Solid Geometry (CSG) Ri. Solid. Begin("difference"); Ri. Solid. Begin("primitive"); Ri. Sphere(1. 0, -1. 0, 360. 0, RI_NULL); Ri. Solid. End(); Ri. Solid. Begin("primitive"); Ri. Disk(2. 0, 0. 5, 360. 0, RI_NULL); Ri. Cylinder(0. 5, -2. 0, 360. 0, RI_NULL ); Ri. Disk(-2. 0, 0. 5, -360. 0, RI_NULL); Ri. Solid. End();

Implementation-specific primitives n n Ri. Geometry( type, parameterlist ) Example: n Ri. Geometry(“teapot”, RI_NULL);

Implementation-specific primitives n n Ri. Geometry( type, parameterlist ) Example: n Ri. Geometry(“teapot”, RI_NULL);

The REYES Rendering Pipeline

The REYES Rendering Pipeline

REYES Pipeline: Overview

REYES Pipeline: Overview

REYES Pipeline: Model primitives read 3 D Model RIB commands RIB Parser RI API

REYES Pipeline: Model primitives read 3 D Model RIB commands RIB Parser RI API RI Calls: Ri. Frame. Begin(0); Frame. Begin 0 World. Begin Translate 0 0 -5 Color [1 1 1] Sphere 1 -1 1 360 World. End Frame. End Ri. World. Begin(); Ri. Translate(0. 0, frame-5. 0); Ri. Color(col); Ri. Sphere(1. 0, -1. 0, 360, RI_NULL); Ri. World. End(); Ri. Frame. End();

REYES Pipeline: Bounding test Compute bounding box Ri. Sphere Eye-space transform View Matrix RI

REYES Pipeline: Bounding test Compute bounding box Ri. Sphere Eye-space transform View Matrix RI API Ri. Basis(Bezier, . . ) View Matrix Cull outside frustum

REYES Pipeline: Splitting n n n Turn a complex primitive into smaller (maybe of

REYES Pipeline: Splitting n n n Turn a complex primitive into smaller (maybe of different type) primitives. Each primitive support must include the algorithm to split into smaller/supported primitives. Like TESSELATION but not necesarily into triangles

REYES Pipeline: Split/Dice Inside Frustum Original Primitive Queue Cull Diceable? Yes Generate µpolygons No

REYES Pipeline: Split/Dice Inside Frustum Original Primitive Queue Cull Diceable? Yes Generate µpolygons No Splitting Primitive Stack n Cull Split Diceable? n n Estimate the pixel area of the bounding box If area > ‘dice threshold’ then SPLIT into smaller primitives

REYES Pipeline: Dice n n Subdivide / dice the primitive into small polygons of

REYES Pipeline: Dice n n Subdivide / dice the primitive into small polygons of ½ a pixel on a side, called µpolygons. The dicing is performed in surface coordinate system: n Each primitive with a projected screen size equal or less than dice threshold is “micropolygonized” using ui, vi as position coordinates.

Why ½ a pixel? n Nyquist sampling limit: if sampling at not enough rate,

Why ½ a pixel? n Nyquist sampling limit: if sampling at not enough rate, the signal couldn´t be uniquely defined by our sampled values. n n n Samples read a completely black surface for a one-pixel-res checker. Aliasing artifacts If Sampling at a twice the pixel freq the artifact is avoided

Why micropolygons? n n Simplicity: Each µpolygon vertex is flat-shaded & textured at only

Why micropolygons? n n Simplicity: Each µpolygon vertex is flat-shaded & textured at only one stage. Accuracy: No attribute interpolation & no perspective correction needed. Visual quality: The model geometry resolution adapts automatically to the viewer distance. Performance: Group µpolygons into Fixed-size grids, sharing vertices: A great work unit for the next stages n n n Resource & memory usage bounded to the working set needed for one or more grids being processed in parallel. Vectorizable shading of a entire grid. Texture locality/less filtering computation (CAT).

RAT: Random Access Texture projection: s = f(world coords x, y, z) P 0

RAT: Random Access Texture projection: s = f(world coords x, y, z) P 0 P 1 Texture requests: sequential but aliased (filtering required for acceptable quality) t P 2 P 3 B(t) = P 0 ( 1 – t )3 + 3 P 1 t ( 1 – t )2 + 3 P 2 t 2 ( 1 – t ) + P 3 t 3 , t є [0, 1]

RAT: Random Access Texture Environment mapping: s = f(view vector, N(t)) P 0 P

RAT: Random Access Texture Environment mapping: s = f(view vector, N(t)) P 0 P 1 Texture requests: random t P 2 P 3 B(t) = P 0 ( 1 – t )3 + 3 P 1 t ( 1 – t )2 + 3 P 2 t 2 ( 1 – t ) + P 3 t 3 , t є [0, 1]

CAT: Coherent Access Texture Projective texture mapping: s = at + b P 0

CAT: Coherent Access Texture Projective texture mapping: s = at + b P 0 P 1 Texture requests: sequential and not aliased. t P 2 P 3 B(t) = P 0 ( 1 – t )3 + 3 P 1 t ( 1 – t )2 + 3 P 2 t 2 ( 1 – t ) + P 3 t 3 , t є [0, 1]

CAT: Coherent Texture Access n n Most used primitive: Patches (u, v expansion) If:

CAT: Coherent Texture Access n n Most used primitive: Patches (u, v expansion) If: n n n Then: n n s = u and t = v, and Grid dimensions are power of 2, like textures. an appropiate dicing will line-up exactly to texels. If textures prefiltered and prescaled as resolution pyramids then almost no filtering is required.

Jittering sampling n n Divide the Pixel area in a 4 x 4 grid.

Jittering sampling n n Divide the Pixel area in a 4 x 4 grid. Sample are generated at random offsets of each cell center point.

Z-buffer n n High-resolution scenes 16 samples per pixel Transparency and CSG require storing

Z-buffer n n High-resolution scenes 16 samples per pixel Transparency and CSG require storing multiple hits in each sample. Huge Z buffer size: n Solution: Bucket rendering. Screen partitioned in small frustums that are sequentially processed.

Advanced Features n Motion Blur: n n For each shaded micropolygon draw the pixel

Advanced Features n Motion Blur: n n For each shaded micropolygon draw the pixel for each sample in many “jittered” times. Depth of field: n For each shaded micropolygon draw the pixel in many “jittered” samples.

Summarizing REYES advantatges n n n Allows rendering of large and complex scenes with

Summarizing REYES advantatges n n n Allows rendering of large and complex scenes with no primitive limit using a small subset of resources. “Adaptative tesselation/subdivision” of high-level primitives into micropolygons improves visual quality. Unlike Raytracing there is high memory locality: n n n Primitive calculations/shading is local (not depending on reflection hits in other primitives) Textures are mostly CAT accessed (Patches the most used primitive) Even the z-buffer exhibits locality with bucket rendering.

Summarizing REYES disadvantages n Shading occurs before the visibility test: n n n Many

Summarizing REYES disadvantages n Shading occurs before the visibility test: n n n Many shading calculations never used. Ideal CAT access requires a costly texture preprocess to make up resolution pyramids. Some high-level primitives are really hard to render (split and dice computation is very expensive) i. e: blobbies and SCGs.

Why is not the REYES-arch wellsuited for interactive 3 D Hw?

Why is not the REYES-arch wellsuited for interactive 3 D Hw?

Geometry on GPU Papers Resolution-Independent Curve Rendering Using Programmable Graphics Hardware Charles Loop, Jim

Geometry on GPU Papers Resolution-Independent Curve Rendering Using Programmable Graphics Hardware Charles Loop, Jim Blinn, Microsoft Research Real-Time GPU Subdivision Kernel Le-Jeng Shiue, Ian Jones, Jorg Peters University of Florida GPU-Based Trimming and Tessellation of NURBS and T-Spline Surfaces Michael Guthe, Ákos Balázs, Reinhard Klein, Universität Bonn Blister: GPU-Based Rendering of Boolean Combinations of Free-Form Triangulated Shapes John Hable, Jarek Rossignac, Georgia Institute of Technology Procedural Geometry Synthesis on the GPU Patrick Lacz John C. Hart University of Illinois Urbana-Champaign

REYES Implementations

REYES Implementations

PIXIE: Open Source Render. Man n n Implements REYES arch. Primitives: n Bicubic/Bilinear, NURB

PIXIE: Open Source Render. Man n n Implements REYES arch. Primitives: n Bicubic/Bilinear, NURB patches, B-Spline patch grid, Points, Cubic/Linear curve, All quadrics, Implicit, Polygonal meshes, Subdivision, Procedurals, Instancing Does not implement: n Blobbies and CSG 90% of source code is about geometry split/dice/intersect algorithms!! Uses Open. GL, but for GUI and Previews.

PIXIE: Source code n Class for Sphere primitive: Class CSphere : public Csurface {

PIXIE: Source code n Class for Sphere primitive: Class CSphere : public Csurface { public: CSphere(CAttributes *, CXform *, CParameter *, unsigned int, float, float); ~CSphere(); void intersect(CShading. Context *, CRay *); // Intersect a ray with the surface int moving() const; // TRUE if we're moving void sample(int, float **, float ***, unsigned int &) const; // Sample the surface of the object void interpolate(int, float ***) const; // Interpolate the variables void instantiate(CAttributes *, CXform *, CRenderer. Context *) const; void dice(CShading. Context *); // Split or render this object void shade(CShading. Context *, int, CRay **); // Shade the object private: Cparameter *parameters; unsigned int parameters. F; float r, umax, vmin, vmax; float *next. Data; void compute. Object. Bound(float *, float, float); };

NVIDIA Gelato n Film-like rendering system using a NVIDIA card.

NVIDIA Gelato n Film-like rendering system using a NVIDIA card.

NVIDIA Gelato n The Rendering pipeline: n Non-Render. Man Spec based. n But arch

NVIDIA Gelato n The Rendering pipeline: n Non-Render. Man Spec based. n But arch very similar to REYES. n Uses also micropolygon, but 1 pixel size. n Uses Open. GL? n The system requeriments states that Gelato requires the last Open. GL NVIDIA driver version.

First steps in my thesis n n Render. Man/REYES scenes are good source for

First steps in my thesis n n Render. Man/REYES scenes are good source for micropolygon workload. Pixie implements subdivision/dicing algorithms for most of the high-level primitives. There are some related papers about subdivision in GPUs. In addition, we can try to find out what GELATO does with Open. GL.

References n n n L. Cook et al. , The Reyes Image Rendering Architecture,

References n n n L. Cook et al. , The Reyes Image Rendering Architecture, SIGGRAPH’ 87 J. D. Owens et al, Comparing Reyes and Open. GL on a Stream Architecture, Graphics Hardware 2002. Patrick Lacz John C. Hart, Procedural Geometry Synthesis on the GPU.