Logistics Checkpoint 2 Mostly graded. Note on grading -- Regaining - - PDF document

logistics
SMART_READER_LITE
LIVE PREVIEW

Logistics Checkpoint 2 Mostly graded. Note on grading -- Regaining - - PDF document

Texture Mapping Logistics Checkpoint 2 Mostly graded. Note on grading -- Regaining points Checkpoint 3 Due Monday Project Proposals All should have received e-mail feedback. 1 Logistics Checkpoint 2 Another


slide-1
SLIDE 1

1

Texture Mapping

Logistics

 Checkpoint 2

 Mostly graded.  Note on grading -- Regaining points

 Checkpoint 3

 Due Monday

 Project Proposals

 All should have received e-mail feedback.

slide-2
SLIDE 2

2

Logistics

 Checkpoint 2

 Another means for finding equation of a

plane

 Using determinants.  See:

http://local.wasp.uwa.edu.au/~pbourke/geometry/planeeq/

Logistics

 Grad students

 Please send topic of grad report.

slide-3
SLIDE 3

3

Projects

 Proposals

 Proposal due before break (please get

yours in if not submitted)

 Feedback on proposals -- mycourses  Web sites please.  23 projects (4-5 more expected)

Projects

 Presentations:

 Dates:

 Week 9: Wed, Feb 13 (sorry Radiosity)  Week 10: Mon, Feb 18  Week 10: Wed, Feb 20  Finals Week / Week 11: Mon, Feb 25

 15 minutes / presentation  Schedule on Web by next class  Please send me choice of time/day

slide-4
SLIDE 4

4

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-5
SLIDE 5

5

Illumination Models

 Illumination model - function or algorithm

used to describe the reflective characteristics

  • f 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

slide-6
SLIDE 6

6

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

slide-7
SLIDE 7

7

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

Watt

slide-8
SLIDE 8

8

Texture Mapping

 Key to texture mapping is

parameterization

 3D geometry must be expressed as a

function of 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

slide-9
SLIDE 9

9

Texture pipeline

Akenine-Moller / Haines

Texture pipeline example

Akenine-Moller / Haines

slide-10
SLIDE 10

10

Projector function

 Converts 3D point in object space

(x,y,z) to 2D point in texture parameter space (u,v)

 Examples:

 Spherical mapping  Cylindrical mapping  Planar mapping  Parametric surface mapping

Projector function

 Spherical Mapping

slide-11
SLIDE 11

11

Projector function – Spherical Mapping

Texture is like a rubber sheet stretched to fit model

Projector function

 Cylindrical mapping

slide-12
SLIDE 12

12

Projector function

 Spherical mapping

Projector function

 Bi-cubic surfaces

slide-13
SLIDE 13

13

Projector function – bicubic surfaces

Watt

Projector function

 Texture Mapping Applets

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

slide-14
SLIDE 14

14

Corresponder function

 Converts from texture parameter space

(u, v) to texel space.

 Controls the way an image is applied  Examples:

 Direct mapping  Use a portion of an image  Apply transforms  Out of range transforms

Texture Mapping - Direct Mapping

slide-15
SLIDE 15

15

Texture Mapping – Using a Portion of the Image

Texture Mapping – out of range

Repeat (tile) Mirror (tile) clamp border

slide-16
SLIDE 16

16

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!

slide-17
SLIDE 17

17

Texture Mapping – Aliasing

Watt

Texture Mapping

 Aliasing -because of interpolation and

perspective projection

aliased image anti-aliased image

slide-18
SLIDE 18

18

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/la nd/OldStudentProjects/cs490- 96to97/anson/TextureMappingApplet/

slide-19
SLIDE 19

19

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

 Mip == “multum in parvo”

 Latin for “many things in a small space”

 Native support in hardware.

Mipmapping

slide-20
SLIDE 20

20

Texture Mapping

 Mipmaps

Texture pipeline

 Break

slide-21
SLIDE 21

21

When we last left our hero Value transform function

 Texture maps need not be just plain old

RGB.

 Texture == data associated with an

  • bject

 Stored in a 2D array of texels

 Value transform function

 Transforms data into value usable by the

illumination model at the shading point

slide-22
SLIDE 22

22

Value Transform functions

 Texel data interpretation:

 Normal displacement – Bump Mapping  Transparency Mask – Alpha Mapping  Reflection – Environment Mapping  Illumination – Light Mapping  Specular component – Gloss Mapping  Lighting intensities – Radiance Mapping

Texture Mapping- Bump Mapping

  • Adds roughness to surfaces
  • Quick way to add detail to

an object

  • Polygon remains physically

flat, but appears bumpy

Jim Blinn

slide-23
SLIDE 23

23

Texture Mapping- Bump Mapping

 Perturbing surface normal  Texture map represents displacements from the

normal

 Use perturbed normal in illumination model

Texture mapping – Bump Mapping

slide-24
SLIDE 24

24

Bump Mapping Theory

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

Bump Mapping-Theory

slide-25
SLIDE 25

25

Bump Mapping

 Perlin Dnoise example

Normal += Dnoise (point)

[Perlin85]

Texture Mapping

 Bump Mapping

slide-26
SLIDE 26

26

Alpha Mapping

 Used to control the transparency.  Example:

3dimpact.com

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

slide-27
SLIDE 27

27

Texture Mapping- Environment 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-28
SLIDE 28

28

Environment Mapping

spherical Cube map

Texture Mapping

 Environment mapping

slide-29
SLIDE 29

29

Texture mapping

Reflection mapping

Light Mapping

 Texture map that describes illumination

(light sources)to apply

flipcode.com

slide-30
SLIDE 30

30

Gloss Mapping

 The texture that controls the specular

reflection color.

 Modulates the the specular reflection

and the environment map.

Gloss Mapping

  • zone3d.net
slide-31
SLIDE 31

31

Texture Mapping

 Static

 Texture map image is taken under a single

lighting condition

 Q: What happens when lighting conditions

  • f the scene doesn’t match that of your

texture?

 A: let’s go to the video tape

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

slide-32
SLIDE 32

32

Texture pipeline

 Finally obtained data is applied in

illumination equation.

Layered Texture Mapping

slide-33
SLIDE 33

33

Layered Texture Mapping

 Applet

http://www.neilwallis.com/java/bump 1.htm

Multipass Texture Rendering

 Multiple textures for multiple parts of

illumination model rendered on multiple passes.

 Modern hardware supports up to 10

passes on a single frame.

slide-34
SLIDE 34

34

Multipass Texture Render

 Quake III Engine

 Passes 1-4: accumulating bump map  Pass 5: diffuse lighting  Pass 6: base texture  Pass 7: Specular  Pass 8: emissive lighting  Pass 9: volumetric effects  Pass 10: screen flashes

Summary

 Texturing Pipeline  Advantages of texture mapping

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

 Issues:

 Aliasing  Limited resolution (zoom in DOOM effect)  Static image

slide-35
SLIDE 35

35

Summary

 In this lecture, we assumed that

textures were pre-generated and saved in a file

 Textures can also be generated on the

fly using a function or procedure…

 But that’s for next time…

 Questions?