Presentation is loading. Please wait.

Presentation is loading. Please wait.

RenderMan (Introduction). Objective Understanding of graphics algorithms  Rendering pipeline Understanding of Technical Director’s role Learning the.

Similar presentations


Presentation on theme: "RenderMan (Introduction). Objective Understanding of graphics algorithms  Rendering pipeline Understanding of Technical Director’s role Learning the."— Presentation transcript:

1 RenderMan (Introduction)

2 Objective Understanding of graphics algorithms  Rendering pipeline Understanding of Technical Director’s role Learning the Shading Language  Notion of Shader

3 Computer graphical Image Synthesis RenderMan – A Brief History Using BMRT The RIB File The Shading Language Writing a Shader Lecture Outline

4 Computer graphical Image Synthesis : Image Synthesis Three routes to image synthesis

5 Computer graphical Image Synthesis : Rendering A renderer being fed a scene description

6 Computer graphical Image Synthesis : Rendering RenderMan converts RIB inputs into images RIB: Renderman Interface Bytestream

7 Computer graphical Image Synthesis : Rendering Stages in a classical rendering pipeline Object Space World Space Camera View Clipping Culling Final Result

8 The RenderMan History Proposed by Pixar in 1989 Its design is based on  Lucasfilm’s REYES (Renders Everything You Ever Saw) in 1981 (Pixar is originally the computer division of Lucasfilm)  Robert Cook’s Shade Trees [COOK84] Since then RenderMan is referred as the industry standard of high-quality graphics production

9 What is RenderMan? An open specification – anybody can implement the standard  Pixar RenderMan, BMRT, RenderDotC A scenefile description for 3D rendering like PostScript is for 2D Programmable shading language C Programming Interface  Can be a standalone program or called from RIB.

10 What is RenderMan Separation of Modeling and Rendering  RenderMan serves as the interface. Scene = Shape + Shading  Two “ languages ” Geometry(Shape) - set of C subroutines Shading - a C-like language Geometry code can be run directly, or output to RIB file Shading code is compiled to byte-code The power of RenderMan is in the shading part

11 Movies containing RenderMan-generated imagery

12 RenderMan Interface

13 RenderMan Interface Bytestream (RIB): Geometry  The scene description language (.rib) can be created by a C program, generated by the modeler, or typed manually  The scene description file defined the geometry and some rendering parameters Shading Language (SL): Shading  A skillful programmer develops the shader (.sl), a C-like program, to control how a surface is shaded. It is then complied to intermediate code (.slo)  The intermediate shader code is interpreted to control the shading process The.rib and.slo are fed to the renderer for rendering

14 RenderMan Interface RIB as an interface between modelers and renderers

15 RIB File Structure

16 Rendering program RenderMan compliant renderer  Pixar’s Photorealistic RenderMan (PRMan)  Exluna’s BMRT, Entropy  ART’s RenderDrive

17 BMRT (Blue Moon Rendering Toolkit) A free implementation of the RenderMan standard  A public-domain implementation of Pixar Photorealistic Rend erMan (PRMan). Three main components:  Rendrib: the renderer  Rgl: quick rendering for preview  Slc: shading language compiler Download  Pixar Renderman BMRT Render 2.6.rar Pixar Renderman BMRT Render 2.6.rar

18 How to Install BMRT Unpack the BMRT Distribution  Choose a directory into which BMRT will be installed (e.g. “c:\BMRT2.6”) Set BMRT Environment Variables  Variable: PATH  Value:[…];C:\BMRT2.6\bin\ (i.e., add C:\BMRT2.6\bin to the end of the current PATH value.)  Variable: BMRTHOME  Value: C:\BMRT2.6\  Variable: SHADERS  Value: C:\BMRT2.6\shaders\

19 How to Install BMRT Testing BMRT  Command  cmd C:\> cd BMRT2.6\examples  C:\BMRT2.6\examples\>  Test rgl C:\BMRT2.6\examples\> c:\BMRT2.6\bin\rgl teapots.rib hit the esc key or q to close the window after it finishes rendering. C:\BMRT2.6\examples\> c:\BMRT2.6\bin\rgl limbo.rib  Test slc C:\BMRT2.6\shaders\> c:\BMRT2.6\bin\slc funkyglass.sl C:\BMRT2.6\shaders\> c:\BMRT2.6\bin\slc screen_aa.sl C:\BMRT2.6\shaders\> c:\BMRT2.6\bin\slc screen.sl  Test rendrib C:\BMRT2.6\examples\> c:\BMRT2.6\bin\rendrib -d 16 shadtest.rib –The -d option to rendrib will display the results directly to the screen –press the w key while over the window to write out a TIFF file –the esc key or q will quit and close the window  Test iv C:\BMRT2.6\examples\> c:\BMRT2.6\bin\iv balls1.tif

20 EditPlus 연동 기본설정 / 사용자도구  [ 그룹이름설정 ] RenderMan  [ 추가  프로그램 ] 메뉴제목 : Render [ 명령 ] C:\BMRT2.6\bin\rendrib.exe [ 인수 ] -d $(FileName) [ 디렉토리 ] $(FileDir)  [ 추가  프로그램 ] 메뉴제목 : Shader [ 명령 ] C:\BMRT2.6\bin\slc.exe [ 인수 ] $(FileName) [ 디렉토리 ] $(FileDir)  [ 추가  프로그램 ] 메뉴제목 : PreRender [ 명령 ] C:\BMRT2.6\bin\rgl.exe [ 인수 ] $(FileName) [ 디렉토리 ] $(FileDir)  [ 추가  프로그램 ] 메뉴제목 : ImageViewer [ 명령 ] C:\BMRT2.6\bin\iv.exe [ 인수 ] $(FileNameNoExt).tiff [ 디렉토리 ] $(FileDir)

21 Using BMRT Rendrib – the command line renderer  Rendrib [flags] -d –Forces display to screen –Put a number afterward and it will render in multiple passes -v – verbose. Tells you more about what is happening while you render. -stats – displays some statistics after rendering about CPU usage, etc. Slc – the shading language compiler  Slc [flags] -dso compile to machine code -o name output to specified name

22 A Simple Scene Making RIB  # : comment ( 주석 )  Display Create a file “min.tiff” Color information “rgb” “file”  write to “file” –“framebuffer”  on the screen  Projection “perspective” projection  WorldBegin / WorldEnd WorldBegin  prepare to draw WorldEnd  the scene is finished  Transformation / Modeling Translation  z 축으로 2 만큼 이동 Sphere  radius: 1, zmin: -1, zmax: 1, theta: 360 #min.rib - a minimal scene Display "min.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 2 Sphere 1 -1 1 360 WorldEnd

23 Transformation  Translate x y z  Scale x y z  Rotate angle x y z  TransformBegin  TransformEnd # beginend.rib Display "beginend.tiff" "file" "rgb" Projection "perspective" WorldBegin # move everything back 2 units Translate 0 0 2 TransformBegin # Everything that follows is one unit left Translate -1 0 0 Sphere 1 -1 1 360 TransformEnd TransformBegin # Everything that follows is one unit right Translate 1 0 0 Sphere 1 -1 1 360 TransformEnd WorldEnd

24 Color Color [ red green blue ]  0~1  AttributeBegin : 속성 설정 시작  AttributeEnd : 속성 설정 종료 # Display "beginend.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 2 Color [ 1 0 0 ] AttributeBegin Translate -1 0 0 Color [ 1 1 0 ] Sphere 1 -1 1 360 AttributeEnd #This resets the colour back to red AttributeBegin Translate 1 0 0 Sphere 1 -1 1 360 AttributeEnd WorldEnd

25 Color Opacity Opacity [ red green blue ] 0: Transparency ( 투명 ) 1: Opaque ( 불투명 ) Display "opacity.tiff" "file" "rgb" Projection "perspective" #PixelSamples 3 3 WorldBegin #move everything back 2 units Translate 0 0 2 Color [ 1 0 0 ] AttributeBegin Translate -0.25 0 0 Color [ 0 1 0 ] Opacity [ 0.5 0.5 0.5 ] Sphere 1 -1 1 360 AttributeEnd AttributeBegin Translate 0.25 0 0 # Opacity [ 0.3 0.3 0.3 ] Sphere 1 -1 1 360 AttributeEnd WorldEnd

26 Camera Setup Camera  Format : 이미지 크기  “fov” Field of View # fov.rib Display "fov.tiff" "file" "rgb" Format 640 480 1.0 Projection "perspective" "fov" [ 25 ] # Projection "perspective" "fov" [ 90 ] Translate 0 0 10 WorldBegin Sphere 2 -2 2 360 WorldEnd

27 Blocks WorldBegin, WorldEnd FrameBegin, FrameEnd frameno AttributeBegin, AttributeEnd TransformBegin, TransformEnd Stacking must always be balanced  AttributeBegin  TransformBegin  AttributeEnd  TransformEndis not legal

28 Simple Surface Parametric Quadrics  Sphere  Cone  Cylinder  Disk  Hyperboloid  Paraboloid  Torus

29 Simple Surface Sphere # sweep.rib Display “sweep.tiff" “file" "rgb" Projection "perspective" WorldBegin Translate 0 0 4 Sphere 2 -2 2 270 WorldEnd

30 Simple Surface Cylinder # Cylin.rib Display "Cylin.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 7 Rotate 90 1 0 0 Cylinder 2 -3 3 270 WorldEnd

31 Simple Surface Cone # Cone.rib Display "Cone.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 -2.5 7 Rotate -90 1 0 0 Cone 5 2 90 WorldEnd

32 Simple Surface Paraboloid # Para.rib Display "Para.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 -0.5 1.5 Rotate 90 0 1 0 Rotate -90 1 0 0 Paraboloid 0.6 0.0 1.0 360 # Paraboloid 1.0 0.25 0.9 330 WorldEnd

33 Simple Surface Hyperboloid # Hyper.rib Display "Hyper.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 2.0 Rotate 90 0 1 0 Rotate -90 1 0 0 Hyperboloid 0.15 -0.8 -0.5 0.25 0.25 0.6 360 # Hyperboloid 0.4 1.0 -0.5 0.5 0.5 1.0 300 WorldEnd

34 Simple Surface Torus # Torus.rib Display "Torus.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 1.5 # Rotate -120 1 0 0 Torus 0.5 0.25 0 360 360 # Torus 0.6 0.1 0 360 120 # Torus 0.55 0.35 0 100 360 WorldEnd

35 Simple Surface Disk # Disk.rib Display "Disk.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 1.0 Disk 0 0.5 360 # Disk 0 0.7 270 WorldEnd

36 Simple Surface Polygon Polygon "P" [...... points..] GeneralPolygon [ poly_vert# vert_hole1# vert_hole2#.....] “P” [....points...] # GPolygon.rib Display "GPolygon.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate -0.5 -0.5 1.0 GeneralPolygon [4 3] "P" [ 0 0 0 1 0 0 1 1 0 0 1 0 0.1 0.1 0 0.9 0.1 0 0.5 0.9 0 ] WorldEnd # Polygon.rib Display "Polygon.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate -0.5 -0.5 1.0 Polygon "P" [ 0 0 0 1 0 0 1 1 0 0 1 0 ] WorldEnd ConvexConcave

37 Simple Surface PointsPolygon [ face1_vert# face2_vert# …. ] [ face1_index1 face1_index2 …. face2_index1 face2_index2 …. …. ] "P" [...... points..] PointsGeneralPolygon [2 (face, hole) 1 (no hole) ….] [ face1_vert# (face) face1_vert# (hole) face2_vert# (face) …. ] [ face1_index1 face1_index2 …. face2_index1 face2_index2 …. …. ] "P" [...... points..] # PPolygon.rib Display "PPolygon.tiff" "file" "rgb" Projection "perspective" WorldBegin Translate 0 0 1.5 Rotate -10 1 0 0 PointsPolygons [3 3 3 3] # 4 faces, each with 3 verts, 12 total [2 1 0 1 0 3 2 0 3 2 1 3] # indices of the 12 verts # following is the vertex array with (x,y,z) pt "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 ] WorldEnd ConvexConcave

38 Patches  Provide curved surface Patch “type” “P” [...... points..]  Type : bilinear, bicubic Ordering of Points # patch.rib Display “patch.tiff" "file" "rgb" Projection "perspective“ “fov” [20] Translate -0.5 -0.5 3 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "pointlight" 2 "from" [-2 2 -2] "intensity" [ 7 ] Color [ 1 0 0 ] Surface "plastic" Patch "bilinear" "P" [ 0 0 0 1 0 0 0 1 0 1 1 0] WorldEnd

39 Patches Bilinear #curved.rib Display "curved.tiff" "file" "rgb" Projection "perspective" "fov" [ 20 ] Translate -0.5 -0.5 4 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "pointlight" 2 "from" [-2 2 -2] "intensity" [ 7 ] Color [ 1 0 0 ] Surface "plastic" Patch "bilinear" "P" [0 0 0 1 0 0 0.4 1 1 #MOVED BACK 0.6 1 -1] #MOVED FORWARDS WorldEnd

40 Patches Bicubic #cubic.rib Display "cubic.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate -0.5 -0.5 3 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "pointlight" 2 "from" [-2 2 -2] "intensity" [ 10 ] Color [ 1 0 0 ] Surface "plastic" Rotate 40 1 0 0 Patch "bicubic" "P" [ 0 0 0 0.4 0 0 0.6 0 0 1 0 0 0 0.4 0 0.4 0.4 3 0.6 0.4 -3 1 0.4 0 0 0.6 0 0.4 0.6 -3 0.6 0.6 3 1 0.6 0 0 1 0 0.4 1 0 0.6 1 0 1 1 0] WorldEnd

41 Lighting  Point light  Distant light  Spot light  Ambient light

42 Point light  Pointlight creates a light that shines equally in all direction  LightSource “pointlight” : 점광원 “from” : 광원의 위치 “intensity” : 빛의 세기  광원과 물체의 거리에 따라 빛 감쇠  Surface 물체의 재질감표현 “plastic”: standard CGI shader #pointlight.rib Display "pointlight.tiff" "file" "rgb" Format 640 480 1.0 Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "pointlight" 1 "from" [ -2 2 -2 ] "intensity" [ 7 ] Surface "plastic" Color [ 1 0 0 ] Sphere 1 -1 1 360 WorldEnd intensity [7]intensity [14]

43 Illuminate  Illuminate [0/1] [0/1] [0/1] … 광원 on/off #illuminate.rib Display "illuminate.tiff" "file" "rgb" Projection "perspective" "fov" [20] Translate 0 0 10 WorldBegin LightSource "pointlight" 1 "from" [4 3 -5] "intensity" [16] LightSource "pointlight" 2 "from" [-4 3 -5] "intensity" [16] Surface "plastic" Color [ 1 0 0 ] AttributeBegin Illuminate 1 1 Translate -0.5 0 0 Sphere 1 -1 1 360 AttributeEnd AttributeBegin Illuminate 1 0 Translate 0.5 0 0 Sphere 1 -1 1 360 AttributeEnd WorldEnd

44 Distant light  LightSource “distantlight” “to” : 광원의 방향  거리에 상관없이 빛의 세기 일정 #distantlight.rib Display "distantlight.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "distantlight" 1 "to" [ 1 0 0 ] "intensity" [ 1 ] Color [ 1 0 0 ] Surface "plastic" Sphere 1 -1 1 360 WorldEnd

45 Spot light  LightSource “spotlight” “from” : 광원의 위치 “to” : 광원의 방향 “coneangle” : out cone “conedeltaangle” : inner cone #spotlight.rib Display "spotlight.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "plastic" Sphere 1 -1 1 360 WorldEnd delta [0.05]delta [0.25]

46 Ambient light  LightSource “ambientlight” : 주변광 “intensity” : 빛의 밝기 “color” [r g b] : 빛의 색깔 #spotambient.rib Display "spotambient.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "plastic" Sphere 1 -1 1 360 WorldEnd AmbientAmbient & Spot light

47 Shading Language Many types of shaders are possible:  Light source shaders  Surface shaders  Atmosphere shaders  Volume shaders…etc. We will discuss only the surface shaders.

48 Standard Shaders  Constant  Matte  Metal  Plastic  Painted plastic  Displacement

49 Constant  “constant” : simplest surface Simpler than the default shader  Surface “constant” #constant.rib Display "constant.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "constant" Sphere 1 -1 1 360 WorldEnd

50 Matte  Simulate the diffuse scattering of light from a rough surface  Surface “matte” #matte.rib Display "matte.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "matte" Sphere 1 -1 1 360 WorldEnd

51 Metal  Metal Objects Reflect bright light, creating a sharp specular highlight  Surface “metal” #metal.rib Display "metal.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "metal" Sphere 1 -1 1 360 WorldEnd

52 Plastic  Combine both a diffuse and a specular component  Surface “plastic” # plastic.rib Display "plastic.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "plastic" Sphere 1 -1 1 360 WorldEnd

53 Painted plastic  Surface “paintedplastic”  “texturename” : 텍스춰 #painted.rib Display "painted.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "paintedplastic" "texturename" ["swirl.tiff"] Rotate 90 1 0 0 Sphere 1 -1 1 360 WorldEnd swirl.tiff

54 Displacement  Surface “plastic”  Displacement “dented” In addition to a surface shader #dented.rib Display "dented.tiff" "file" "rgb" Projection "perspective" "fov" [ 30 ] Translate 0 0 5 WorldBegin LightSource "ambientlight" 1 "intensity" [ 0.1] LightSource "spotlight" 2 "from" [-2 2 -2] "to" [ 0 0 0 ] "intensity" [ 7 ] "coneangle" [0.25] "conedeltaangle" [0.05] Color [ 1 0 0 ] Surface "plastic" Displacement "dented" Sphere 1 -1 1 360 WorldEnd


Download ppt "RenderMan (Introduction). Objective Understanding of graphics algorithms  Rendering pipeline Understanding of Technical Director’s role Learning the."

Similar presentations


Ads by Google