CS 468 Cg Texture Mapping Jon Moon Spring 2004 Computer Science Cornell University.

Slides:



Advertisements
Similar presentations
William A.P. Smith and Edwin R. Hancock Department of Computer Science, University of York, UK CVPR 2009 Reporter: Annie Lin.
Advertisements

Michael I. Gold NVIDIA Corporation
Topics in Computer Graphics Spring Application.
Bump Mapping CSE 781 Roger Crawfis.
Week 8 - Friday.  What did we talk about last time?  Radiometry  Photometry  Colorimetry  Lighting with shader code  Ambient  Directional (diffuse.
Computer Graphics I, Fall 2010 Shading II.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
ADVANCED SKIN SHADING WITH FACEWORKS Nathan Reed — NVIDIA March 24, 2014.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
WILLIAM MOSS ADVANCED RENDERING COURSE PROJECT DECEMBER 4 TH, 2008 Real-time rendering of water and bubbles.
Shading II CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
Computer Graphics (Spring 2008) COMS 4160, Lecture 20: Illumination and Shading 2
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Status – Week 277 Victor Moya.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Environmental Maps Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
1 Lecture 9 Lighting Light Sources Reflectance Camera Models.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
SET09115 Intro Graphics Programming
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
Modelling and Simulation Types of Texture Mapping.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
CS 481 Preview, Some Lighting Details Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, November 19, 2003.
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.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
CSE 690: GPGPU Lecture 6: Cg Tutorial Klaus Mueller Computer Science, Stony Brook University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
UV Mapping After a 3D object has been modeled it must be prepared for texturing. 3D surfaces can be “unwrapped” into a 2D representation with. This process.
GLSL II.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
3D Objects in WebGL Loading 3D model files. Announcement Midterm exam on 12/2 –No Internet connection. –Example code and exam questions will be on USB.
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Advanced Texture Mapping Bump Mapping & Environment Mapping (Reflection)
Physically-based Illumination Models (2) CPSC 591/691.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Reflection Models (1) Physically-Based Illumination Models (2)
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
Ying Zhu Georgia State University
Week 8 - Monday CS361.
Reflective Shadow Mapping By: Mitchell Allen.
Tips for Shading Your Terrain
Programmable Pipelines
School of Computer Science
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Introduction to Computer Graphics with WebGL
CS5500 Computer Graphics April 17, 2006 CS5500 Computer Graphics
Exploring Shaders in Unity
Computer Graphics 4Practical Lesson
Computer Graphics Practical Lesson 10
Computer Graphics 5Practical Lesson
Programming with OpenGL Part 3: Shaders
CS 480/680 Computer Graphics GLSL Overview.
Environment Mapping.
Computer Animation Surface Materials.
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

CS 468 Cg Texture Mapping Jon Moon Spring 2004 Computer Science Cornell University

Agenda  NVIDIA’s Cg Browser effects Bump Mapping Reflection Mapping Thin Film Bump Horizon Mapping Car Paint Bumpy Shiny Patch  Watch demo, understand the shaders

Cg Commands  saturate(x): same as clamp(x,0,1)  lerp(a,b,f): (1-f)*a + b*f  lit(ndotl, ndoth, m): returns Blinn model {ambient, diffuse, specular,1}  length(x), distance(x1,x2), pow(x,y), etc.

Simple fp20 Bump Mapping  Goal: Bumpy Earth  What should the FP do? Vertex inputs? Uniform Parameters? Outputs? Code?

Simple fp20 Bump Mapping  Goal: Bumpy Earth  What should the VP do? Inputs? Uniform Parameters? Textures? Code?

Texture reads in Cg  Need uniform parameter for the texture itself: sampler2d, sampler3d, etc.  Need to call appropriate texture read function, with appr. Params: tex2d(my2dTexture, myCoords)

Simple fp20 Bump Mapping  Texture read code (out of context): float2 decalCoords : TEXCOORD0; uniform sampler2D decal, etc. float3 decalColor = tex2D(decal, IN.decalCoords).rgb;  OpenGL side will be covered next week!

Bump Reflection Mapping  Goal: Achieve reflection using normal map, environment map  What kind of textures will we use?

Bump Reflection Mapping  float4 normal = tex2D(NormalMap);  Color = texCUBE_reflect_dp3x3(Environmen tMap, TangentToCubeSpace0, TangentToCubeSpace1, normal); transforms the normal, computes the reflected vector, and uses that to lookup into cubemap.

Thin Film Interference  Goal: produce thin film color patterns (think oil or soap bubbles)  Plan: calculate the depth of film on the surface of object, based on view/normal angle Use depth as lookup and get color, use that to modify specular component

Bump Horizon Mapping  Goal: bump mapping with self- shadowing  Theory: create horizon maps that store the elevation angle needed in a particular direction at each point  Use the horizon maps nearest the light direction to find elevation, compare to light vector

Bump Horizon Mapping  Can encode 4 horizon maps in one texture, with 1 elevation in each RGBA value.  Thus horizon maps for 8 cardinal directions (N, NE, etc.) can be encoded nicely in 2 textures

Car Paint  Goal: Make realistic car paint Fresnel effect Flecks in paint Wavy normals Reflection Fancy paint BRDF  Plan: Use a ton of textures

Bumpy Shiny Patch  Goal: (go watch it!)  What mapping effects are being used?

Other possibilities?  Iridescence: color is view dependent  Gloss mapping: reflectivity differs over object  Height field, offset bump maps  Be creative! Be clever!

Resources  Cg User Manual: users_manual.html Also in Cg Toolkit folder  Cg Browser download: toolkit.html Part of the Cg Toolkit (~100 MB)