Even more jobs Spring Career Fair Shading Architectures Fair - - PDF document

even more jobs
SMART_READER_LITE
LIVE PREVIEW

Even more jobs Spring Career Fair Shading Architectures Fair - - PDF document

Even more jobs Spring Career Fair Shading Architectures Fair Wednesday, March 28th 11am - 4pm Gordon Field House Interviews Thursday, March 29th www.rit.edu/recruit Plan Shader Architectures Today RenderMan


slide-1
SLIDE 1

1

Shading Architectures

Even more jobs

 Spring Career Fair

 Fair

 Wednesday, March 28th  11am - 4pm  Gordon Field House

 Interviews

 Thursday, March 29th

 www.rit.edu/recruit

Plan

 Today

 Shader Architectures

 Next Week

 Shader Language Specifics  Tuesday: Lecture  Thursday: Lab

Shader Architectures

 RenderMan  Cg  How they are alike  How they are different

Shader System

 Common traits:

 Scene separate from shader

 “load” a “compiled” shader  Parameter passing between scene and shader  Global “graphics state” variables  Shader programs components of rendering

pipeline.

RenderMan

 Renderman consists of three parts:

 Functional scene description mechanism (API for

C) Renderman is an Interface!

 State Model Description – Maintains a current graphics

state that can be placed onto a stack.

 Geometry is drawn by utilizing the current graphics state.

 File format - Renderman Interface Bytestream

(RIB)

 Shading Language and Compiler. https://renderman.pixar.com/products/rispec/index.htm

slide-2
SLIDE 2

2

Rendering using RenderMan

Renderer (prman)

Shaders (compiled shader code) 3D Scene Description (RIB) Texture Map

Runtime architecture

Rendering application

RenderMan

Graphics state Shader 1 Shader 2 Shader 3

slc

Shader / render link

Shader “object” file Shader “object” file Shader “object” file

Renderman Shading Language

 Renderman Shading Language

 Inspired by Cook’s shade trees  Goals

 Abstract shading language based on ray optics,

independent of any specific algorithm or implementation

 Interface between rendering program and

shading model

 High level language that is easy to use.

Renderman Shading Language

 Unlike other shading languages, RenderMan allows

for procedural definition of all types of light transport, not just reflection

 Light emission  Atmospheric effects  Reflection  Transmission  Transformations  Bump Mapping

Renderman Shading Language

 Types of shaders

 Light source shaders - calculates the color of

a light being emitted in given direction.

 Surface reflectance shaders - computes the

light reflected from a surface in a given direction

 Volume shaders - implements the effect of

light passing through a volume of space, i.e., exterior, interior and atmospheric scattering effects.

Renderman Shading Language

 Types of Shaders

 Displacement Shaders - perturb the surface of

an object

 Imager Shader - post processing on image

pixels.

slide-3
SLIDE 3

3 Renderman Shading Language

[Renderman Companion, 277]  Dataflow Model

RenderMan scene

 RenderMan assumes a basic “graphics state”

scene model

 Scene hooks into shader

 Achieved via predefined “global” variables

 Result of shader

 Achived by setting other predefined “global”

variables.

 Shaders programmed independently from

  • ther shaders

Renderman Shading Language

[Renderman Companion, 277]  Dataflow Model

Renderman Shading Language Attaching shaders to object

  • RiLightHandle RiLightSource (“name”, parameterlist); or

LightHandle LightSource “name” parameterlist

  • sets shader “name” to be the current light source shader
  • RiSurface (“name”, parameterlist); or

Surface “name” parameterlist

  • sets shader “name” to be the current surface shader.
  • RiAtmosphere (“name”, parameterlist); or

Atmosphere “name” parameterlist

  • sets shader “name” to be the current atmosphere shader.

Light Shaders

[Renderman Companion, 277]

Light Shaders

 Define color and intensity of light in a

given direction

 Light is “collected” by other shaders not

“emitted” by light source shader

 Light shaders define “potential” light that

can be collected later.

slide-4
SLIDE 4

4

Light Shaders Surface Shaders

[Renderman Companion, 277]

Surface Shaders

 Defines color/opacity at a surface point  Can query defined light sources  Approaches

 Illumination Model  Image Textures  Procedural Textures  Bump Mapping

Illumination Models Image Texture Mapping Environment Mapping

slide-5
SLIDE 5

5

Procedural Textures

Olano, 1998, http://www.cs.unc.edu/~olano/papers/dissertation/ plain Grooved mortar grain Different colored bricks Different colors within bricks

Procedural Texture Displacement Shaders

[Renderman Companion, 277]

Displacement Shaders

 Used to perturb normal to give

appearance of wrinkles

 Basic bump mapping  Applied before surface shader

Displacement Shader Volume shaders

[Renderman Companion,277]

slide-6
SLIDE 6

6

Volume Shader

 Defines change of color/opacity of light

going through a volume

 Fog, smoke, fire, haze

Volume shader

Imager Shader

[Renderman Companion, 277]

Imager Shader

 Allows for postprocessing of final

rendered image

 Applied pixel-by-pixel  Tone reproduction  Non-photorealistic rendering  Supported in prman?

Imager Shader Shader order in prman

 Displacement Shader  Surface Shader

 Queries light shaders

 Volume Shaders  Imager Shader  prman creates bytecode for SIMD

virtual machine for compiled shaders

slide-7
SLIDE 7

7

Summary -- RenderMan

 Interface -- not a renderer

 Independent of actual implementation

 Scene / Shader separation  Shaders define interactions of light &

geometry modification

 Light / Surface / Displacement / Volume / Imager

 break

Real-time Shading

 Linked to hardware  RenderMan == GOOD

 Can it be done on the graphics card?

 Assembler  Higher level language

Real time vs Off-line shading

 Interactivity

 Viewpoints will change

 Performance is critical

 Frame to frame

 Execute on GPUs

 Restrictions

 Memory  Registers  Texture units and memory  Data type accuracy

Graphics Hardware Pipeline Graphics Hardware Pipeline

 Vertices

 define geometrical primitives  Position in 3D space  Color / text coords / materials / etc.

 Fragments

 “pixel state” -- Correspond to pixels  3D -> 2D

 Projection  Scan conversion

Graphics Hardware Pipeline

slide-8
SLIDE 8

8

Shading applets

 Gouraud:

 http://www.vidimce.org/college/school/cs4

413.f96/program.6/

Programmable Graphics Pipeline Programmable Graphics Pipeline

 Vertex processor

 Operates on vertices  Vertex shaders

 Fragment processor

 Operates on fragments  Fragment / Pixel shader

GPU Assembler Cg Environment

 Cg == “C for Graphics”

 Proceed with caution.

 Standard APIs

 Layer of standardization / abstraction from

graphics card (GPU)

 OpenGL  Direct3D

Cg Enviornment

 Cg Compilation

 Indirect link to GPU

 Compiles to interface with OpenGL or Direct3D

layer

 OpenGL/DirectX will command the GPU

 CGRuntime

slide-9
SLIDE 9

9

Cg Environment

 Putting it all together

CgFX

 File format for encapsulating complete

render state for an effect

 Allows for “packaging of effects”  Loading of effects in external applications.

 Maya  3D Studio Max  SoftImage

CgFX Some realtime demos So what, you say

 nVidia videos

Unintended effects

 GPUs are good processors in their own

right

 Programming non-graphical apps on

GPUs

 Image Processing  Numerical Computation  Animation  Data Mining

slide-10
SLIDE 10

10

Cg Summary

 Platform / Hardware independent

language

 Scene / Shader separation  Shaders Linked to hardware

 Only fragment and vertex shaders

 Questions

Next week

 Lecture: Language nuts and bolts  Lab: RenderMan / Cg “Hello World”