Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Monday, 24 April 2006 Shaun Budhram (Slides.

Slides:



Advertisements
Similar presentations
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Advertisements

Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
3D Graphics Rendering and Terrain Modeling
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
(conventional Cartesian reference system)
Status – Week 277 Victor Moya.
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 RenderMan & Its Shading Language.
Programmable Shading May 21, Motivation Recall what are done in the graphics pipeline: –Front End: Transformations (Modeling, Viewing, and Projection)
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
RenderMan (Shading Language: Concepts)
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Week 2 - Wednesday CS361.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Texture Mapping.
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
A Crash Course in HLSL Matt Christian.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Computer Science Term 1, 2006 Tutorial 5 The Final Exam.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
RenderMan Introduction CS 551/645 Fall Evaluate Me! Please visit the SEAS main website and use the ‘Course Evaluations’ button to rate this class.
Game Programming 06 The Rendering Engine
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 9 of 41 William H. Hsu Department of Computing.
Image Synthesis Rabie A. Ramadan, PhD 4. 2 Review Questions Q1: What are the two principal tasks required to create an image of a three-dimensional scene?
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
CS380: Computer Graphics Distributed Ray Tracing TA Course URL:
RenderMan (Introduction). Objective Understanding of graphics algorithms  Rendering pipeline Understanding of Technical Director’s role Learning the.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 2: Complete Programs Ed Angel Professor.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
Advanced rendering techniques 4/2/02. Rendering for animation The big difference: real time vs. off-line Real time: sacrifice quality for performance.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
CS 551/645 Introduction to Computer Graphics Fall 2000.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
Computer Graphics.
© University of Wisconsin, CS559 Spring 2004
Visualization Shading
Programmable Pipelines
Graphics Processing Unit
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
© University of Wisconsin, CS559 Fall 2004
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Chapter V Vertex Processing
CS5500 Computer Graphics April 17, 2006 CS5500 Computer Graphics
ICG 2018 Fall Homework1 Guidance
Programmable Shading May 15, 2006.
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Frame Buffer Applications
Presentation transcript:

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Monday, 24 April 2006 Shaun Budhram (Slides modified from Rich Pickler’s 2001 Tutorial) Department of Computing and Information Sciences, KSU Readings: Chapter 7, Advanced RenderMan Introduction to Renderman Lecture 38 of 42

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Lecture Outline Readings: Advanced RenderMan, Chapter 7 Suggested Exercises: Stretching RenderMan – A Brief History Using BMRT The RIB File The Shading Language Writing a Shader Invaluable Resources

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics RenderMan – A Brief History Began at ILM research department, later Pixar 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 Directly Linked DSO Can be a standalone program or called from RIB.

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Using BMRT A free implementation of the RenderMan standard Available at 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

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics The RIB File Structure State Machine similar to OpenGL C-linkage Options global to the entire animation Frame Block Image options Camera options World Block Attributes, lights, primitives Changed Options Another world block Next frame block

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Types, Variables, Spaces Available types FloatThe only single number type. Use for counters as well as normal applications of floats. PointFloat Triplet VectorFloat Triplet NormalFloat Triplet ColorFloat Triplet Matrix4x4 Transformation Matrix StringUsed for filenames, etc.

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Types, Variables, Spaces Variables global to all shaders Ultimate Goal: Ci, Oi point PPosition of the point you are shading. Changing this variable displaces the surface. normal NThe surface shading normal at P. Changing N causes bump mapping. normal NgThe true surface normal at P. This can differ from N; N can be overridden in various ways including bump mapping and user provide vertex normals, but Ng is always the true surface normal of the facet you are shading. vector IThe incident vector, pointing from the viewing position to the shading position P. color Cs, OsThe default surface color and opacity, respectively. float u,vThe 2D parametric coordinates of P (on the particular geometric primitive you are shading). float s, tThe 2D texturing coordinates of P. These values can default to u,v but a number of mechanisms override the original values. vector dPdu, dPdv The partial derivatives (ie, tangents) of the surface at P. TimeThe time of the current shading sample. float du, dvAn estimate of the amount that the surface parameters u and v change from sample to sample. vector L, color Cl These variables contain the information coming from the lights and may be accessed from inside illuminate loops only. color Ci, OiThe final surface color and opacity of the surface at P. Setting these two variables is the primary goal of a surface shader.

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Types, Variables, Spaces Spaces Specified as a cast to variables –point blah = point “shader” (.5.5.5); Or using the transform functions: transform, vtransform, ntransform –point transform( string toSpaceName; point p_current); CurrentThe coordinate system that all points start in and the one in which all lighting calculations are carried out. Note that the choice of “current” space may be different on each renderer ObjectThe local coordinate system of the graphics primitive (sphere, patch, etc.) that we are shading. ShaderThe coordinate system active at the time that the shader was declared (by the Surface, Displacement, or LightSource statement). WorldThe coordinate system active at WorldBegin. CameraThe coordinate system with its origin at the center of the camera lens, x-axis pointing right, y-axis pointing up, z-axis pointing into the screen. ScreenThe perspective-corrected coordinate system of the camera’s image plane. Coordinate (0,0) in “screen” space is looking along the z-axis of “camera” space. RasterThe 2D projected space of the final output image, with units of pixels. Coordinate (0,0) in “raster” space is the upper left corner of the image, with x and y increasing to the right and down, respectively.

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Writing a Shader (cont’d) Simple Sample: Phong shader surface phong ( float Ka=1, Kd=1, Ks=0.5, roughness=0.1; color specularcolor=1; ) { /* Simple Phong Illumination Model */ normal Nf = faceforward(normalize(N),I); vector V = -normalize(I); Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + Ks*specularcolor*specular(Nf,V,roughness); Oi = Os; Ci *=Oi; }

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Writing a Shader (cont’d) Attaching to the RIB file *********** AttributeBegin Translate Rotate Color [ ] Surface "phong" "Ka" [.1] "Kd" [.8] "Ks" [1] "roughness" [0.1] "specularcolor" [1 1 1] Basis "bezier" 3 "bezier" 3 PatchMesh "bicubic" 13 "nonperiodic" 10 "nonperiodic" "P" [ **************

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Writing a Shader (cont’d) Other Shader types –Displacement Shaders – describe how surfaces wrinkle or bump. –Light Shaders – describe the directions, amounts and colors of illumination and distributed by a light source in the scene. –Volume Shaders – describe how light is affected as it passes through a participating medium such as smoke or haze. Advanced Topics –Anti-Aliasing – calculus! –Lens flares –Smoke, Clouds –Cartoon Shaders –Lighting models

Kansas State University Department of Computing and Information Sciences CIS 736: Advanced Computer Graphics Readings: Advance RenderMan, Chapter 7 Suggested Exercises: Stretching RenderMan – A Brief History Using BMRT The RIB File The Shading Language Writing a Shader Invaluable Resources –BMRT homepage – –Renderman Newsgroup – comp.graphics.rendering.renderman – –The Renderman Interface Specification. Available at Lecture Outline