renderman primitives renderman primitives
play

RenderMan Primitives RenderMan Primitives CSCD 472? Slide 1 - PowerPoint PPT Presentation

RenderMan Primitives RenderMan Primitives CSCD 472? Slide 1 4/5/10 Primitive Attributes Primitive Attributes Two different methods of attaching attributes to primitives: Graphics state attributes inherited by the primitive from the


  1. RenderMan Primitives RenderMan Primitives CSCD 472? Slide 1 4/5/10

  2. Primitive Attributes Primitive Attributes Two different methods of attaching attributes to primitives: Graphics state attributes inherited by the primitive from the attributes on top of the stack. Attributes that are part of the geometric description of the primitive – provided in parameter lists of the primitive call. These override attributes inherited from the Graphics State. CSCD 472? Slide 2 4/5/10

  3. Attributes inherited from Graphics State - Attributes inherited from Graphics State - set in RIB set in RIB Color Attributes: Color color - provide 3 values (RGB) from 0 to 1. Opacity color – sets the default opacity for each color component as a value between 0.0 and 1.0 (inclusive) Matte flag – allows an object to be used to create a hole where the object would have been for later compositing. CSCD 472? Slide 3 4/5/10

  4. Attributes inherited from Graphics State - Attributes inherited from Graphics State - set in RIB set in RIB Shaders: 3 primary attributes specified by shaders: Surface shadername parameterlist – specifies details concerning surface materials of primitive. Displacement shadername parameterlist – specifies where and how much a surface geometry should be moved. Atmosphere shadername parameterlist – specifies atmospheric effects such as fog, smoke or distance related changes in color Several primitive variables are made available to shaders. CSCD 472? Slide 4 4/5/10

  5. Attributes inherited from Graphics State - Attributes inherited from Graphics State - set in RIB set in RIB Shading: ShadingRate area – specifies a max distance between shader samples – how often the shader is run. A shading rate of 1.0 shades each pixel and is often used for high quality renders. ShadingInterpolation style – specifies how to interpolate if a shader needs shading values between sample points the value of style says how to interpolate: “constant” - reuse neighbor samples “smooth” - use bilinear interpolation – Gouraud shading. CSCD 472? Slide 5 4/5/10

  6. Attributes inherited from Graphics State - Attributes inherited from Graphics State - set in RIB set in RIB Sidedness: Sides n – n = 1 gives one-sided primitives if n = 2 then 2 sided primitives – surface normals will NOT automatically flip for back sides – the renderer must do this. Orientation direction – determines which way a normal points – if direction is: “outside” - use default normal “inside” - normal is flipped and the primitive is inside out. CSCD 472? Slide 6 4/5/10

  7. Primitive Variables Primitive Variables Set by geometric primitive calls. Used to pass primitive attributes to shaders. Override attributes set in RIB and control many parts of the rendering pipeline such as: How slicing and dicing works How color values are interpolated across the surface of a primitive. Each primitive variable (whether user or pre- declared) has a type and a storage class Values are passed to commands creating primitives and to shaders as parameter lists labeled by the variable name. CSCD 472? Slide 7 4/5/10

  8. Primitive Variables Primitive Variables Storage classes of primitive variables: vertex – one piece of data for each primitive vertex. varying – one data element at each parametric corner (number of corners depends on the primitive type. Varying data is interpolated bilinearly in the parametric space of the primitive. uniform – one data element for each surface facet – number of facets depends on primitive type and attribute settings. constant – one piece of data for each entire primitive. CSCD 472? Slide 8 4/5/10

  9. Primitive Variables Primitive Variables Data Types – generally the same as the types used in shader parameters and variables – will be covered in the shader section. Commonly used primitive variables : “P” - vertex point – or “Pw” vertex hpoint used to pass vertex data to the primitive in 3D (“P”) or homogeneous (“Pw”) coordinates “N” varying normal – normal vectors used in shading calculations (Phong shading) “Cs” – varying color – Surface color – usually provided on a per vertex basis but may be interpolated (thus the varying class). Values are 0 – 1 for each of R, G, B. CSCD 472? Slide 9 4/5/10

  10. Primitive Variables Primitive Variables Commonly used primitive variables : “Os” - varying color – Opacity – like surface color is usually provided on a per vertex basis. Values range from 0(fully transparent) to 1(fully opaque). “st” - varying float[2] – Texture coordinates. Values range from 0 – 1. CSCD 472? Slide 10 4/5/10

  11. Primitive Variables Primitive Variables When accessed in shaders - where no slicing or dicing occurs: constant and uniform variables have class uniform. vertex and varying variables have class varying. When any geometric data is specified for a primitive it is assumed to be in “object” space. CSCD 472? Slide 11 4/5/10

  12. Polygons and Polyhedra Polygons and Polyhedra RenderMan offers two types of polygons convex and concave (possibly with holes) and two types of polyhedra(polygon meshes) one using only convex polygons and one using concave polygons. For all four types vertex information is provided through “P” - an array of floating point numbers specifying X, Y, and Z coordinates of vertices. Each group of 3 values is a point - thus 12 floating point values for a quadrilateral. CSCD 472? Slide 12 4/5/10

  13. Polygons and Polyhedra Polygons and Polyhedra Polygon parameterlist A single convex polygon with any number of vertices. Example: Polygon "P" [-100 -100 10 -100 100 10 100 100 10 100 -100 10] CSCD 472? Slide 13 4/5/10

  14. Polygons and Polyhedra Polygons and Polyhedra GeneralPolygon loopverts parameterlist A single concave polygon – or polygon with holes - with any number of vertices. GeneralPolygons are specified with one or more vertex loops – the first specifies the outer boundary of the polygon and each additional loop specifies the outer boundary of a single hole. loopverts – an array with an entry for each loop with each entry containing the number of vertices in that loop. CSCD 472? Slide 14 4/5/10

  15. Polygons and Polyhedra Polygons and Polyhedra Example: (A large triangle with a small triangular hole) GeneralPolygon [3 3 ] "P" [ -1 0 0 0.5 -0.87 0 0.5 0.87 0 -0.0832 -0.1442 0 0.1665 4.2603818e-008 0 -0.0832 0.1442 0] CSCD 472? Slide 15 4/5/10

  16. Polygons and Polyhedra Polygons and Polyhedra PointsPolygons nverts vertids parameterlist A mesh of convex polygons with any number of faces or vertices. nverts – an array of values – the number of values determines the number of faces – each value specifies how many vertices are connected to form each face vertids – a large array with an entry(vertex index) for each vertex in each face - determines which vertices are connected together to form each face. CSCD 472? Slide 16 4/5/10

  17. Polygons and Polyhedra Polygons and Polyhedra PointsPolygons [3 3 3 3] [2 1 0 1 0 3 2 0 3 2 1 3] "P" [ 0.664 0.000 -0.469 0.000 -0.664 0.469 0.000 0.664 0.469 -0.664 0.000 -0.469 ] "Cs" [1.0 0.2253 0.0 0.925 1.0 0.0 0.28 0.0823 0.2706 0.99 0.95 0.98] CSCD 472? Slide 17 4/5/10

  18. Polygons and Polyhedra Polygons and Polyhedra PointsGeneralPolygons nloops loopverts vertids parameterlist A mesh of concave (each possibly with holes) polygons with any number of faces or vertices. nloops – an array of values – the number of values determines the number of faces – each value specifies how many loops there are in that face (often 1 only). loopverts - an array – describes how many vertices are in each loop (faces or holes). vertids – a large array with an entry(vertex index) for each vertex in each face – determines which vertices are connected together to form each face. CSCD 472? Slide 18 4/5/10

  19. Polygons and Polyhedra Polygons and Polyhedra PointsGeneralPolygons [1 1 1 1 1] [4 4 4 3 3] [3 4 1 0 4 5 2 1 5 3 0 2 1 2 0 5 4 3] "P" [-2.59919 -1.53668 -4.50193 -2.59919 -1.53668 4.50193 5.19838 -1.53668 0 -2.59919 1.53668 -4.50193 -2.59919 1.53668 4.50193 5.19838 1.53668 0] "facevarying normal N" [-1 0 -5.29592e-08 -1 0 -5.29592e-08 -1 0 -5.29592e-08 -1 0 -5.29592e-08 0.5 0 0.866025 0.5 0 0.866025 0.5 0 0.866025 0.5 0 0.866025 0.5 0 -0.866025 0.5 0 -0.866025 0.5 0 -0.866025 0.5 0 -0.866025 0 -1 -6.29353e-09 0 -1 -6.29353e-09 0 -1 -6.29353e-09 0 1 0 0 1 0 0 1 0] CSCD 472? Slide 19 4/5/10

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend