Topics in Computer Graphics Spring 2010. Application.

Slides:



Advertisements
Similar presentations
Michael I. Gold NVIDIA Corporation
Advertisements

Exploration of bump, parallax, relief and displacement mapping
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.
Patrick Cozzi University of Pennsylvania CIS Fall 2013
Environment Mapping CSE 781 – Roger Crawfis
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 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Shading in OpenGL CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
CS 468 Cg Texture Mapping Jon Moon Spring 2004 Computer Science Cornell University.
Status – Week 277 Victor Moya.
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.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
What is ? Open Graphics Library A cross-language, multi-platform API for rendering 2D and 3D computer graphics. The API is used to interact with a Graphics.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Shading in OpenGL.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Environment Mapping. Examples Fall Motivation Silver candlestick No appropriate texture for it “ environment ” map Simulates the results of ray-tracing.
Geometric Objects and Transformations. Coordinate systems rial.html.
CS 480/680 Computer Graphics Shader Applications Dr. Frederick C Harris, Jr. Fall 2011.
Computer Graphics I, Fall 2010 Shading in OpenGL.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 445 / 645: Introductory Computer Graphics Light.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Eighty-color-channel lighting Zoltán Márton Cecília Sik Lányi University of Pannonia Egyetem u. 10.
Game Programming 06 The Rendering Engine
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shader Applications Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
Bump Map 1. High Field Function: H(u, v) New Normal : N’
2009 GRAPHICS : PROJECT 1 BASED ON DX9 BASICS. Documented by Dongjoon Kim SNU CS Ph.D Course Student Contact : NOTE.
Lab: Vertex Shading Chris Wynn Ken Hurley. Objective Hands-On vertex shader programming Start with simple programs … Part 1: Textured-Lit Teapot.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Current Student – University of Wisconsin – Stout Applied Mathematics and Computer Science: Software Development Associate Degree in Computer Programming.
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.
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
OpenGL Shading Language
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.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Advanced Texture Mapping Bump Mapping & Environment Mapping (Reflection)
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
Ying Zhu Georgia State University
Week 7 - Monday CS361.
Tips for Shading Your Terrain
Carl Johan Gribel, PhD student
How to Bump Map a Skinned Polygonal Model
School of Computer Science
CS451Real-time Rendering Pipeline
Vectors, Normals, & Shading
Shading in OpenGL Ed Angel
Day 05 Shader Basics.
Chapter IX Bump Mapping
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Chapter XIV Normal Mapping
Computer Graphics 5Practical Lesson
Advanced Texture Mapping
Environment Mapping.
Computer Graphics Shading in OpenGL
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science
Texture Mapping Jung Lee.
Presentation transcript:

Topics in Computer Graphics Spring 2010

Application

Shading

Maps Base texture (RGB) Height map (Grey scale) Normal map (normal encoded RGB)

Normal Map & Height Field

Normal Map Normal vector encoded as rgb [-1,1] 3  [0,1] 3 : rgb = n* RGB decoding in fragment shaders vec3 n = texture2D(NormalMap, texcoord.st).xyz * 2.0 – 1.0 In tangent space, the default (unit) normal points in the +z direction. Hence the RGB color for the straight up normal is (0.5, 0.5, 1.0). This is why normal maps are a blueish color Normals are then used for shading computation Diffuse: nl Specular: (nh) shininess Computations done in tangent space

In order to build this Tangent Space, we need to define an orthonormal (per vertex) basis, which will define our tangent space. Tangent space is composed of 3 orthogonal vectors (T, B, N) Tangent (S Tangent) Bitangent (T Tangent) Normal One has to calculate a tangent space matrix for every single vertex Tangent Space

Suppose a point p i in world coordinate system for whose texture coordinates are (u i, v i ) Writing this equation for the points p1, p2 and p3, defining the triangle : p 1 = u 1.T + v 1.B p 2 = u 2.T + v 2.B p 3 = u 3.T + v 3.B

Tangent Space p 2 - p 1 = (u 2 - u 1 ).T + (v 2 - v 1 ).B p 3 - p 1 = (u 3 - u 1 ).T + (v 3 - v 1 ).B (v 3 - v 1 ).(p 2 - p 1 ) = (v 3 - v 1 ).(u 2 - u 1 ).T + (v 3 - v 1 ).(v 2 - v 1 ).B - (v 2 - v 1 ).(p 3 - p 1 ) - (v 2 - v 1 ).(u 3 - u 1 ).T - (v 2 - v 1 ).(v 3 - v 1 ).B (u 3 - u 1 ).(p 2 - p 1 ) = (u 3 - u 1 ).(u 2 - u 1 ).T + (u 3 - u 1 ).(v 2 - v 1 ).B - (u 2 - u 1 ).(p 3 - p 1 ) - (u 2 - u 1 ).(u 3 - u 1 ).T - (u 2 - u 1 ).(v 3 - v 1 ).B (v 3 - v 1 ).(p 2 - p 1 ) - (v 2 - v 1 ).(p 3 - p 1 ) T = (u 2 - u 1 ).(v 3 - v 1 ) - (v 2 - v 1 ).(u 3 - u 1 ) (u 3 - u 1 ).(p 2 - p 1 ) - (u 2 - u 1 ).(p 3 - p 1 ) B = (v 2 - v 1 ).(u 3 - u 1 ) - (u 2 - u 1 ).(v 3 - v 1 ) 6 eqns, 6 unknowns T,B: (unit) vectors in object space

TBN Matrix Per Vertex Use the averaged face normal as the vertex normal Do the same for tangent and bitangent vectors Note that the T, B vectors might not be orthogonal to the normal vector Use Gram-Schmidt to make sure they are orthonormal

Coordinate Transformation Tangent space to object space Object space to tangent space This reference ( is correcthttp://jerome.jouvie.free.fr/OpenGl/Lessons/Lesson8.php TyphoonLabs is not right.

What is mat3 (v1,v2,v3)?! It turns out to be “blue” This is the matrix that converts object space to tangent space

Reference er_4.pdf er_4.pdf p.html p.html studios.dk/projects/downloads/tangent_matrix_derivation.php studios.dk/projects/downloads/tangent_matrix_derivation.php