1 / 115

RenderMan

Explore the RenderMan API for graphics rendering, its compatibility with various renderers, and the flexibility it offers for complex digital effects. Compare RenderMan with other commercial packages and learn how to install and use the BMRT renderer.

patd
Download Presentation

RenderMan

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RenderMan Jae Woo Kim Doctoral Student, Institute for Computer Graphics The George Washington University

  2. The Goal of Today

  3. What is RenderMan • API for graphics rendering • Designed by Pixar in 1988 • Photosurrealistic Rendering • Used in many movies with digital effects • Shading Language • Flexibility for complex digital effects • Many RenderMan compliant Renderers

  4. RenderMan compliant Renderers • PhotoRealistic RenderMan (PRMan) • by Pixar • $5,000 per cop • Blue Moon Rendering Tools (BMRT) • Made by Dr. Larry Gritz • Maintained by Exluna Inc. • Free for non-commercial use ( until last year I guess … )

  5. Comparison: RenderMan vs. OpenGL / DirectX

  6. RenderMan vs Commercial packages

  7. Rendering Overview Application Program RenderMan compliant Renderer Scene Description (RIB format) Shading Requests / Results Shading Requests / Results User-defined Shading Modules Standard Shading Modules

  8. Application Program • All API calls starts with Ri prefix • All API calls generate RIB(RenderMan Interface Bytestream) output RiAttributeBegin (); RiTranslate (0.0, 14.0, -8.3); RiSufrace (“plastic”, RI_NULL); RiSphere (1.0, -1.0, 1.0, 360.0, RI_NULL); RiAttributeEnd (); RiAttributeBegin (); RiTranslate (0.0, 14.0, -8.3); RiSufrace (“plastic”, RI_NULL); RiSphere (1.0, -1.0, 1.0, 360.0, RI_NULL); RiAttributeEnd (); AttributeBegin Translate 0.0, 14.0, -8.3 Sufrace “plastic” Sphere 1 –1 1 360 AttributeEnd AttributeBegin Translate 0.0, 14.0, -8.3 Sufrace “plastic” Sphere 1 –1 1 360 AttributeEnd

  9. BMRT • Most widely used public domain RenderMan compliant renderer • Two versions of renderer • rgl: previewer based on OpenGL • rendrib: Photorealistic rendering with ray tracing / radiosity • Input: RIB stream • Output: image files or framebuffer

  10. How to Install BMRT • Remove old version • Unpack BMRT distribution • Set BMRT environment variables • Test BMRT

  11. Set MBRT Environment Variables • Right click, select properties • Select Advanced tab • Click Environment Variables • Set variables My Computer

  12. The first very simple program

  13. Listing 2.1 Geometry Light Surface property

  14. Program Structure RiBegin() //Initialize RenderMan Interface RiLightSource("distantlight",RI_NULL ); RiWorldBegin() RiSurface("constant", RI_NULL ); RiPolygon( 4, RI_P, (RtPointer) square, RI_NULL ); RiWorldEnd() RiEnd() // End!!!

  15. Define a polygon RiPolygon( 4, RI_P, (RtPointer) square, RI_NULL ); Last argument Terminating token The number of vertices Token-value pair: “An array of points giving positions in 3D space” RtPoint square[4] = { {.5,.5,.5 },{-.5,.5,.5}, {-.5,-.5,.5},{.5,-.5,.5} };

  16. Define Surface Property RiSurface("constant", RI_NULL ); RiPolygon( … ); constant matte metal plastic Surface shaders … next week!

  17. Define a light source RiLightSource("distantlight",RI_NULL ); Ambientlight Distantlight Pointlight spotlight Light source shaders … also next week!!

  18. The second very simple program

  19. Listing 2.2 Color Translation Rotation Perspective projection

  20. Projection and Color RiProjection( "perspective", RI_NULL ); perspective orthographic static RtColor Color = { .2, .4, .6 }; R G B RiSurface( … ); RiColor(Color); RiPolygon( … );

  21. Scope of Graphics Environment RiSurface( … ); RiColor(Color); RiPolygon( … ); RiPolygon( … ); RiColor(Color); RiPolygon( … ); • Affects all objects after it • Modifies the previous attribute

  22. Graphics Environment Attributes of objects • Affects all objects after it • Modifies the previous attribute (not • for the transformations…) • Called before the object declaration • “Sticks to that object” • Default values (not for light sources) Transformations Color Light sources Surface properties Etc.

  23. Geometric Transformations y x z RiTranslate( 0.0, 0.0, 1.0 ); Specify the motion along the x, y, z axes respectively RiRotate( 40.0, -1.0, 1.0, 0.0 ); A point in 3D space Amount of rotation In degrees Axis of rotation “Left handed rotation!!!”

  24. The Order of Geometric Transformations RiTranslate()  RiRotate() RiRotate()  RiTranslate()

  25. Geometric transformations accumulated! A B C D RiTranslate(-0.3,0.0,0.0); Object A; RiTranslate(-0.1,0.0,0.0); Object B; RiTranslate(0.1,0.0,0.0); Object C; RiTranslate(0.3,0.0,0.0); Object D; 0.3 - 0.3 - 0.1 0.1 - 0.3 0 - 0.4

  26. The third very simple program

  27. Six rectangles

  28. Declare a Cube (1) A cube consists of six rectangles, so create six rectangles (Listing 2.3) Near, far, left, right, bottom, top defined in a function UnitCube( ) Problem: Readability – Difficult to read and understand

  29. Declare a Cube (2) To use previously defined, simpler objects to createmore complex ones Cube is nothing but a set of squares in different positions and orientation Therefore, create six identical squares, and then transform each square to be located appropriate position in 3D space Click me: Listing 2.5

  30. Declare Cube Square 1; /* RiPolygon( ) */ Rotate 90 degree; /* RiRotate( ) */ Square 2; Rotate 90 degree; Square 3; Rotate 90 degree; Square 4; Square 4 Square 3 Square 1 Square 2

  31. Save and Restore Geometric Transformations Save current transform. RiTransformBegin(); Square 1; Square 2 rotated; Square 3 rotated; Square 4 rotated; RiTransformEnd(); RiTransformBegin(); Square 5; RiTransformEnd(); RiTransformBegin(); Square 6; RiTransformEnd(); Accumulated Restore current transform. Accumulated transform cleared!!

  32. The fourth program – a little complicated … 

  33. Cubes • A number of small cubes • R, G, B values of the cube vary with x, y, z coordinates • Near-lower-left corner is black, far-upper-right corner is • white • Each minicube given a color appropriate to its position • Inner loop of ColorCube( ) cycles n times through x, y, • z creating unit cubes, scaling them appropriately, then • translating them into position

  34. Save and restore attributes • RiAttibuteBegin( ), RiAttributeEnd( ) • Save and restore all the attributes of the graphics environment • Not only geometric transformations RiAttributeBegin(); RiTransformBegin(); Transformations… Attributes … Objects … Objects… RiAttributeEnd(); RiTransformEnd();

  35. Algorithm Loop x = 0 to n-1 Loop y = 0 to n-1 Loop z = 0 to n-1 Set color values; RiTransformBegin(); Transformations; Scale; Call UnitCube(); RiTransformEnd(); Listing 2.6

  36. Primitive Surfaces Everything visible in a scene is ultimately composed of surfaces • Quadric Surfaces: Defined by quadric equations in two • dimensional space • Polygonal SurfacesBoundaries are given by a connected • series of line segments • Parametric Surfaces: Free form polynomial curved surfaces

  37. Primitive Surfaces (I): Quadric Surfaces

  38. Sphere Cone Cylinder Hyperboloid Paraboloid Torus

  39. Quadric surfaces Finite curve in two dimensions is swept in three-dimensional space about one axis to create a surface Sphere Circle Torus Line segment, one end lying on the axis of rotation Cone Cylinder A line segment parallel to the axis Generalization of a line segment, By rotating an arbitrary line segment Hyperboloid Paraboloid Paraola y = x2

  40. Sphere RiSphere(0.5, -0.5, 0.5, 360.0, RI_NULL); RiSphere(radius, zmin, zmax, thetamax, RI_NULL);

  41. Cone RiCone(1.0, 0.5, 360.0, RI_NULL); RiSphere(height, radius, thetamax, RI_NULL);

  42. Cylinder RiCylinder(0.5, -0.5, 0.5, 360.0, RI_NULL); RiCylinder( radius, zmin, zmax, thetamas, Parameterlist )

  43. Hyperboloid RiHyperboloid(hyperpt1, hyperpt2, 360.0, RI_NULL); RiHyperboloid(point1, point2, thetamax, parameterlist);

  44. Paraboloid RiParaboloid(0.5, 0.0, 0.9, 360.0, RI_NULL); RiParaboloid(rmax, zmin, zmax, thetamax, parameterlist);

  45. Torus RiTorus(.4, .15, 0.0, 360.0, 360.0, RI_NULL); RiTorus(majorrad, minorrad, phimin, phimax, parameterlist);

  46. Disk RiDisk(height, radius, thetamax, parameterlist);

  47. Primitive Surfaces (II): Polygons

  48. Polygons • A simple, easy-to use class of surface • Defined by boundary, given as an ordered series of vertices • Square in Listing 2.x RtPoint square[4] = { {.5,.5,.5 },{-.5,.5,.5}, {-.5,-.5,.5},{.5,-.5,.5} }; RiPolygon( 4, RI_P, (RtPointer) square, RI_NULL );

  49. How to Use RIB Models RiWorldBegin (); RiSurface ("matte", RI_NULL); RiReadArchive("bench.rib", RI_NULL, RI_NULL); RiWorldEnd();

More Related