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

renderman primitives renderman primitives
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Slide 1 CSCD 472? 4/5/10

RenderMan Primitives RenderMan Primitives

slide-2
SLIDE 2

Slide 2 CSCD 472? 4/5/10

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

  • verride attributes inherited from the Graphics

State.

slide-3
SLIDE 3

Slide 3 CSCD 472? 4/5/10

Attributes inherited from Graphics State - set in RIB Attributes inherited from Graphics State - 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.

slide-4
SLIDE 4

Slide 4 CSCD 472? 4/5/10

Attributes inherited from Graphics State - set in RIB Attributes inherited from Graphics State - 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

  • r distance related changes in color

Several primitive variables are made available to shaders.

slide-5
SLIDE 5

Slide 5 CSCD 472? 4/5/10

Attributes inherited from Graphics State - set in RIB Attributes inherited from Graphics State - 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.

slide-6
SLIDE 6

Slide 6 CSCD 472? 4/5/10

Attributes inherited from Graphics State - set in RIB Attributes inherited from Graphics State - 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.

slide-7
SLIDE 7

Slide 7 CSCD 472? 4/5/10

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.

slide-8
SLIDE 8

Slide 8 CSCD 472? 4/5/10

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.

slide-9
SLIDE 9

Slide 9 CSCD 472? 4/5/10

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.

slide-10
SLIDE 10

Slide 10 CSCD 472? 4/5/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

  • paque).

“st” - varying float[2] – Texture coordinates. Values range from 0 – 1.

slide-11
SLIDE 11

Slide 11 CSCD 472? 4/5/10

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.

slide-12
SLIDE 12

Slide 12 CSCD 472? 4/5/10

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.

slide-13
SLIDE 13

Slide 13 CSCD 472? 4/5/10

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]

slide-14
SLIDE 14

Slide 14 CSCD 472? 4/5/10

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.

slide-15
SLIDE 15

Slide 15 CSCD 472? 4/5/10

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]

slide-16
SLIDE 16

Slide 16 CSCD 472? 4/5/10

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.

slide-17
SLIDE 17

Slide 17 CSCD 472? 4/5/10

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]

slide-18
SLIDE 18

Slide 18 CSCD 472? 4/5/10

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.

slide-19
SLIDE 19

Slide 19 CSCD 472? 4/5/10

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]