BRDF f ( , , , ) r i i r r camera Computer 3D - - PDF document

brdf f r i i r r camera computer 3d synthetic tone model
SMART_READER_LITE
LIVE PREVIEW

BRDF f ( , , , ) r i i r r camera Computer 3D - - PDF document

Paper Summaries Any takers? Texture Mapping Assignments Projects Checkpoint 2 Approx 18 projects Graded getting points back Listing of projects now on Web Checkpoint 3 Presentation schedule Due


slide-1
SLIDE 1

1

Texture Mapping

Paper Summaries

  • Any takers?

Assignments

  • Checkpoint 2

– Graded – getting points back

  • Checkpoint 3

– Due Wednesday – Note about the value 1.0 – Roundoff error!

  • Checkpoint 4 / RenderMan

– To be given Wednesday

Projects

  • Approx 18 projects
  • Listing of projects now on Web
  • Presentation schedule

– Presentations (15 min max) – Last 3 classes (week 10 + finals week) – Sign up

  • Email me with 1st , 2nd , 3rd choices
  • First come first served.

Computer Graphics as Virtual Photography

camera (captures light) synthetic image camera model (focuses simulated lighting)

processing

photo processing tone reproduction real scene 3D models Photography: Computer Graphics: Photographic print

Remember this?

  • Bi-directional Reflectance Function

) , , , (

r r i i r

f BRDF θ φ θ φ =

At a given point, gives relative reflected illumination in any direction with respect to incoming illumination coming from any direction

slide-2
SLIDE 2

2

Illumination Models

  • Illumination model - function or algorithm used

to describe the reflective characteristics of a given surface.

  • More accurately, function or algorithm used to

approximate the BRDF.

Phong Model

specular diffuse ambient

V) R ( N) S ( ) (

∑ ∑

  • +
  • +

=

i k i i s i i i d a a

e

L k L k L k V L

Question

  • What if Phong (or other) Illumination

models aren’t good enough?

– Texture Mapping – use an image – Procedural Shading – program your own

Texture Mapping

  • Developed in 1974 by Ed Catmull, currently

president of Pixar

  • Goal: Make Phong shading less plastic looking

Texture Mapping

  • A means to define surface characteristics of

an object using an image

  • Mapping a 2D image onto a 3D surface
  • Coordinate spaces in texture mapping

– Texture space (u, v) – Object space (xo,yo,zo) – Screen space (x, y)

Texture Mapping - Uses

  • Surface color - most common
  • Normal vector perturbations (bump mapping)
  • Reflection

– illumination

  • specular
  • diffuse
  • transparency

– environment mapping

slide-3
SLIDE 3

3

Texture Mapping

Watt

Texture Mapping

  • Key to texture mapping is parameterization

– 3D geometry must be expressed as a function

  • f 2 variables, u and v.

– Examples:

  • Planar
  • Spherical
  • Bi-cubic patch
  • Cylindrical

Texture Mapping

texture space (u,v)

  • bject space (xo,yo, zo)

screen space (x,y)

parameterization projection

Texture Mapping

  • Spherical Mapping

Texture Mapping

  • Bi-cubic surfaces

What is a texture?

  • Two Types:

– Image file – Mathematically/procedurally generated

  • Contents:

– Made up of texels – Photos shot straight on – E.g., wood grain, marble, patterns

slide-4
SLIDE 4

4

Texture mapping

Photographic Textures

Direct Mapping

  • Simplest form of mapping
  • Texture coordinates equal polygon
  • coordinates. (u = x and v = y )
  • How to fill? Polygon filling

– Same scanline algorithm as CGI – color data pulled from texture array

Texture Mapping - Direct Mapping

Texture mapping

Photographic Textures

Texture Mapping - Direct Mapping

  • Problems:

– Causes texture to be clipped, or entire polygon not filled.

  • Solution:

– Need an algorithm that stretches & shrinks texture over a polygon. Affine mapping comes to the rescue.

Texture Mapping - Affine Mapping

  • Stretching and shrinking of the texture is

based on the premise of sampling.

  • Texture coordinates become necessary

– Arbitrary mapping of texture coordinates to polygon coordinates

  • Additional calculations required

– dxdy, dudy, dvdy all need to be calculated for each edge. dudx, dvdx for each scanline.

slide-5
SLIDE 5

5

Texture Mapping – Affine Mapping

Texture is like a rubber sheet stretched to fit model

Texture Mapping

Watt

Texture Mapping – Affine Mapping (Warping)

⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎝ ⎛ = ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ ⎞ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎛ 1 Matrix n Translatio Matrix Rotation Matrix Projection 1 n v u z y x

Foley/VanDam(745)

Texture Mapping - Affine Mapping

  • But this can have different problems due to sampling:

– Small textures on large models/polygons tend to become blocky. – Large textures on small models/polygons tend to become grainy.

Texture Mapping

  • There are other mappings as well

– e.g., cylindrical – Any mapping from 3D -> 2D will do

Projective Texture

Texture Mapping

  • Texture Mapping Applets

http://www.cs.brown.edu/exploratories/free Software/catalogs/texture_mapping.html

slide-6
SLIDE 6

6

Texture mapping – Bump Mapping Texture Mapping- Bump Mapping

Adds roughness to surfaces Quick way to add detail to an

  • bject

Polygon remains physically flat, but appears bumpy

Jim Blinn

Bump Mapping Theory

  • If your eyes see light and dark bumps
  • Flat surfaces reflect more light
  • Bumpy surfaces reflect less

Bump Mapping Theory

  • Surfaces angled upward tend to be

brightly lit

  • Downward inclined surfaces tend to be

darker

Bump Mapping-Theory

Texture Mapping- Bump Mapping

  • Perturbing surface normal
  • Texture map represents displacements from the

normal

  • Use perturbed normal in illumination model
slide-7
SLIDE 7

7

Bump Mapping

  • Perlin Dnoise example

Normal += Dnoise (point)

[Perlin85]

Texture Mapping

  • Bump Mapping

Bump Mapping

  • Applet

http://users.interfriends.net/maurid/Bump Mapping.htm Texture Mapping- Environment mapping

  • Create an image, representing the reflection of the

world onto an object

  • Use surrounding sphere or box, image is texture map

indexed by direction of reflection ray

  • Poor-man’s ray tracing - cheaper
  • Can also be used to do illumination (image-based

lighting)

Texture Mapping- Illumination mapping

  • Not associated with a particular object but with

an imaginary surface surrounding the scene

– Specular Reflection – indexed by reflected ray – Diffuse - by surface normal – Transparency – refracted ray direction

Environment Mapping

slide-8
SLIDE 8

8

Texture Mapping

  • Environment mapping

Texture mapping

Reflection mapping

Texture Mapping

  • Advantages of texture mapping

– Easy way to add complexity to a scene – Hardware support

  • Issues:

– Aliasing - because of holes or overlaps – Limited resolution (zoom in DOOM effect) – Static image

Texture mapping

  • Aliasing

– Sampling – images are discrete, not continuous. – Resolution of sampled space (in this case texture map) is not fine enough

Texture mapping

  • Aliasing- point sampling in middle of pixel - need

more!

Texture Mapping – Aliasing

Watt

slide-9
SLIDE 9

9

Texture Mapping

  • Aliasing -because of interpolation and perspective

projection

aliased image anti-aliased image

Texture Mapping - Anti-aliasing

  • Point sample at higher resolution (sometimes very

difficult)

– Nearest

  • Pick the closest texel

– Linear

  • Take an average of surrounding texels

– Mip-Mapping

  • Multiple textures of the same image
  • Use low pass filter before sampling
  • Can sometimes use stochastic sampling to improve

results

Texture mapping

  • Texture Map Aliasing Applet

http://www.nbb.cornell.edu/neurobio/land/ OldStudentProjects/cs490- 96to97/anson/TextureMappingApplet/

Texture Mapping

  • Mipmaps

– Pre-calculate your texture map at many resolutions (or layers) – Store all “texture layers” in a single image. – Use “appropriate” layer when performing rendering, interpolating between levels as required:

Texture Mapping

  • Mipmaps

Texture Mapping

  • Mipmaps - dimensions
slide-10
SLIDE 10

10

Texture Mapping

  • Static

– Texture map image is taken under a single lighting condition – What happens when lighting conditions of the scene doesn’t match that of your texture?

Texture Mapping – Radiance Maps

  • Provides approximated radiance values, not

simply color info, as a texture.

  • Radiance map not only for the distant scene,

but in reflections from objects.

  • Radiance in map used in global illumination

solution

  • Technique used in Fiat Lux

Recent Texture Research

  • 2001 Proceedings

– Illumination & Texture Photorealism: Texture Mapping Progressive Meshes – Procedural Modeling: Feature Based Cellular Texturing – Point-Based: Surface Splatting

Recent Texture Research

  • 2003 Proceedings

– GraphCut Textures – Wang Tiles – Synthesis of Progressively Variant Textures on Arbitrary Surfaces – View Dependent Displacement Mapping