Shading. Flat shading Gouraud shading Phong shading

Similar documents
Texture and other Mappings

Announcements. Written Assignment 2 is out see the web page. Computer Graphics

Shading/Texturing. Dr. Scott Schaefer

CT5510: Computer Graphics. Texture Mapping

Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Texturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica

Texture Mapping and Sampling

Cap. 3 Textures. Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre

OpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Illumination Models & Shading

CSE528 Computer Graphics: Theory, Algorithms, and Applications

INF3320 Computer Graphics and Discrete Geometry

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, Recommended

Overview. Hierarchy. Level of detail hierarchy Texture maps Procedural shading and texturing Texture synthesis and noise.

CS5620 Intro to Computer Graphics

Texture Mapping. Reading. Implementing texture mapping. Texture mapping. Daniel Leventhal Adapted from Brian Curless CSE 457 Autumn 2011.

Computer Graphics. - Texturing Methods -

Texture Mapping. Brian Curless CSE 457 Spring 2015

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, 8.10,

+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Texture mapping. Computer Graphics CSE 167 Lecture 9

Texture. Texture Maps

Texture Mapping. Brian Curless CSE 457 Spring 2016

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

How do we draw a picture?

CS 5600 Spring

Texture Mapping. Computer Graphics, 2015 Lecture 9. Johan Nysjö Centre for Image analysis Uppsala University

Objectives. Texture Mapping and NURBS Week 7. The Limits of Geometric Modeling. Modeling an Orange. Three Types of Mapping. Modeling an Orange (2)

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Chapter 1 Introduction. Marc Olano

CS 432 Interactive Computer Graphics

Fog example. Fog is atmospheric effect. Better realism, helps determine distances

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

w Foley, Section16.1 Reading

Reading. 12. Texture Mapping. Texture mapping. Non-parametric texture mapping. Required. w Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8.

Texture. Detail Representation

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Topics and things to know about them:

Computer Graphics

3D Rasterization II COS 426

CS 130 Final. Fall 2015

CS212. OpenGL Texture Mapping and Related

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

Shading , Fall 2004 Nancy Pollard Mark Tomczak

Texture Mapping 1/34

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Lecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009

Pipeline Operations. CS 4620 Lecture 10

Computer Graphics Texture Mapping

Computer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73

CPSC / Texture Mapping

CS 5625 Lec 2: Shading Models

Bump Mapping Which one of these two image has a better visual effect?

Homework #2. Shading, Ray Tracing, and Texture Mapping

+ = To Do. Texture Mapping. Adding Visual Detail. Parameterization. Option: Varieties of projections. Computer Graphics. geometry

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

Illumination and Shading

+ = To Do. Adding Visual Detail. Texture Mapping. Parameterization. Option: Varieties of projections. Foundations of Computer Graphics (Fall 2012)

Lecture 07: Buffers and Textures

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

Surface Rendering. Surface Rendering

CS452/552; EE465/505. Texture Mapping in WebGL

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒

9. Illumination and Shading

Evolution of Imaging Technology in Computer Graphics. Related Areas

Visualisatie BMT. Rendering. Arjan Kok

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

Motivation. towards more realism. + Texture Mapping Texture Mapping

CIS 536/636 Introduction to Computer Graphics. Kansas State University. CIS 536/636 Introduction to Computer Graphics

LIGHTING AND SHADING

Multiple Importance Sampling

Texture Mapping 1/34

Computer Graphics Texture Mapping

CS 431/636 Advanced Rendering Techniques

CISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation

INF3320 Computer Graphics and Discrete Geometry

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Buffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

SUMMARY. CS380: Introduction to Computer Graphics Texture Mapping Chapter 15. Min H. Kim KAIST School of Computing 18/05/03.

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Lecture 11of 41. Surface Detail 2 of 5: Textures OpenGL Shading

OpenGL Lighting Computer Graphics Spring Frank Palermo

Lighting and Texturing

Zeyang Li Carnegie Mellon University

5.2 Shading in OpenGL

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

Texture Mapping and Special Effects

Illumination and Shading

frame buffer depth buffer stencil buffer

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Pipeline Operations. CS 4620 Lecture 14

Transcription:

Shading Flat shading Gouraud shading Phong shading

Flat Shading and Perception Lateral inhibition: exaggerates perceived intensity Mach bands: perceived stripes along edges

Icosahedron with Sphere Normals Gouraud shading vs flat shading effect

One Subdivision

Two Subdivisions Each time, multiply number of faces by 4

Three Subdivisions Reasonable approximation to sphere

Phong Shading Results Michael Gold, Nvidia Phong Lighting Gouraud Shading Phong Lighting, Phong Shading

Texture and other Mappings Texture Mapping Bump Mapping Displacement Mapping Environment Mapping

We could specify all texture coordinates by hand

Tools help us unroll an object to paint it Tools help us unroll an object to paint it www.uvmapper.com

Uses for Texture Mapping Use texture to affect a variety of parameters surface color - radiance of each point on surface (Catmull 1974) surface reflectance - reflectance coefficients k d, k s, or n shiny normal vector - bump mapping (Blinn 1978) geometry - displacement mapping transparency - transparency mapping (clouds) (Gardener 1985) light source radiance - environment mapping (Blinn 1978)

Radiance vs. Reflectance Mapping + = Sphere w/ Uniform Diffuse coefficient Radiance Map Sphere w/ Radiance Map Texture specifies (isotropic) radiance for each point on surface + = Sphere w/ Uniform Diffuse coefficient Reflectance (k d ) Map Sphere w/ Reflectance Map Texture specifies diffuse color (k d coefficients) for each point on surface - three coefficients, one each for R, G, and B radiance channels

Bump Mapping Basic texture mapping paints on to a smooth surface How do you make a surface look rough? Option 1: model the surface with many small polygons Option 2: perturb the normal vectors before the shading calculation Real Bump Fake Bump Flat Plane + = Sphere w/diffuse Texture Map Bump Map Sphere w/diffuse Texture + Bump Map

Bump Mapping We can perturb the normal vector without having to make any actual change to the shape. This illusion can be seen through how? Original model (5M) Simplified (500) Simple model with bump map

Bump Mapping Greg Turk

Another Bump Mapping Example + = Bump Map Cylinder w/diffuse Texture Map

Displacement Mapping Use texture map to displace each point on the surface Texture value gives amount to move in direction normal to surface How is this different from bump mapping?

Environment Mapping Specular reflections that mirror the environment

Environment Mapping Specular reflections that mirror the environment Cube is a natural intermediate object for a room eye

Environment Mapping: Cube Maps

Basics of Texture Mapping in OpenGL Glubyte my_texels[512][512][3]; Gluint texid; glgentextures(1, &texid); glbindtexture(gl_texture_2d, texid); glteximage2d(gl_texture_2d, 0, GL_RGB, 512, 512, 0, GL_RGB,GL_UNSIGNED_BYTE, my_texels); /* level, components, w, h, border, format, type, array t */ /* assign texture coordinates */ glenable(gl_texture_2d); glbegin(gl_quad); gltexcoord2f(0.0, 0.0); glvertex3f(x1,y1,z1); gltexcoord2f(1.0, 0.0); glvertex3f(x2,y2,z2); gltexcoord2f(1.0,1.0); glvertex3f(x3,y3,z3); gltexcoord2f(0.0,1.0); glvertex3f(x4,y4,z4); glend(); gldisable(gl_texture_2d);

Grungy details we ve ignored Specify s or t out of range? Use GL_TEXTURE_WRAPin gltexparameterbecause many textures are carefully designed to repeat Aliasing? Mapping doesn t send you to the center of a texel. Can average nearest 2x2 texels using GL_LINEAR Mipmapping: use textures of varying resolutions. 64x64 becomes 32x32,16x16,8x8,4x4,2x2 and 1x1 arrays with glubuild2dmipmaps

Texture Generation Photographs Drawings Procedural methods (2D or 3D) (2D: stripe, wave, and noise patterns 3D: sculpting in marble and granite)

Reaction-Diffusion Greg Turk, Siggraph 91 Procedural Methods

Solid Textures Have a 3-D array of texture values (e.g., a block of marble) In practice the map is often defined procedurally No need to store an entire 3D array of colors Just define a function to generate a color for each 3D point The most interesting solid textures are random ones Evaluate the texture coordinates in object coordinates - otherwise moving the object changes its texture! Ken Perlin's talk "Making Noise" From: An Image Synthesizer by Ken Perlin, SIGGRAPH '85