CS 395: Adv. Computer Graphics Overview Surface Detail Maps Watt: Chapter 8 + readings Due Date...

25
CS 395: Adv. Computer CS 395: Adv. Computer Graphics Graphics Overview Overview Surface Detail Maps Surface Detail Maps Watt: Chapter 8 + readings Watt: Chapter 8 + readings Due Date Reminders: Due Date Reminders: Feb 4 Feb 4 - project proposal, or - project proposal, or Feb 4 Feb 4 - reference list for survey paper - reference list for survey paper Jack Tumblin Jack Tumblin [email protected] [email protected]
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of CS 395: Adv. Computer Graphics Overview Surface Detail Maps Watt: Chapter 8 + readings Due Date...

CS 395: Adv. Computer GraphicsCS 395: Adv. Computer Graphics

OverviewOverviewSurface Detail MapsSurface Detail Maps

Watt: Chapter 8 + readingsWatt: Chapter 8 + readings

Due Date Reminders:Due Date Reminders: Feb 4Feb 4 - project proposal, or - project proposal, or Feb 4Feb 4 - reference list for survey - reference list for survey

paperpaper  

Jack TumblinJack [email protected]@cs.northwestern.edu

Basic ProblemBasic Problem

• Big problem: even ‘simple’ objects are not...Big problem: even ‘simple’ objects are not...

Image Credit: Pixar/Renderman 1984

Basic ProblemBasic Problem

• Big problem: even ‘simple’ objects are not...Big problem: even ‘simple’ objects are not...

• Practical ways to add accurate local details?Practical ways to add accurate local details?Image Credit: Pixar/Renderman 1984

Surface Detail MappingSurface Detail Mapping

Basic Idea:Basic Idea:• Simple polygons for primary 3D shape infoSimple polygons for primary 3D shape info• ‘ ‘Texture’ image: secondary 2D/3D details stored in 2DTexture’ image: secondary 2D/3D details stored in 2D• Quickly ‘paint’ 2D details onto simple polygonsQuickly ‘paint’ 2D details onto simple polygons• Hardware support now commonplaceHardware support now commonplace

Texture Texture Mapping...Mapping...

‘‘Digital’ Image: a 2D Grid of NumbersDigital’ Image: a 2D Grid of Numbers

• NO intrinsic meaning—use it for NO intrinsic meaning—use it for anything:anything:

reflectance, transparency, illumination, reflectance, transparency, illumination, normal direction, material, velocity...normal direction, material, velocity...

uu

vv

uu

vv

Texture Map: Bilinear InterpolationTexture Map: Bilinear InterpolationImage Credit:Image Credit:Nate RobinsNate Robins

Basic ideasBasic ideasInverse mapping:Inverse mapping:

for each image pixel (x,y)for each image pixel (x,y)find texture address (u,v)find texture address (u,v)get value (may skip texels!)get value (may skip texels!)

Forward mapping:Forward mapping:for each texel (u,v), for each texel (u,v), find image address (x,y)find image address (x,y)put value (may skip pixels!)put value (may skip pixels!)

xx

yy

vv

uu

uu

vv

Bilinear Interpolation: 2 Problems...Bilinear Interpolation: 2 Problems...

Aliasing ErrorsAliasing Errors(1 pixel maps to > 1 texel)(1 pixel maps to > 1 texel)(can be much worse!)(can be much worse!)

Image Credit:Image Credit:Nate RobinsNate Robins

Bilinear Interpolation: 2 Problems...Bilinear Interpolation: 2 Problems...

Aliasing ErrorsAliasing Errors(1 pixel maps to > 1 texel)(1 pixel maps to > 1 texel)(can be much worse!)(can be much worse!)

Image Credit:Image Credit:Nate RobinsNate Robins

BlurringBlurring(1 pixel maps to < 1 texel)(1 pixel maps to < 1 texel)

MIP-map Filter (L.Williams, 1983)MIP-map Filter (L.Williams, 1983)

• Inverse sampling: find texture address from x,y Inverse sampling: find texture address from x,y • Sample texture from a ‘pyramid’ of images,Sample texture from a ‘pyramid’ of images,

each one ¼ size of the previous.each one ¼ size of the previous.• Match transformed pixel spacing to texel spacingMatch transformed pixel spacing to texel spacing• Good, but blurry; Good, but blurry;

nondirectionalnondirectional

Image Credit:Image Credit:Nate RobinsNate Robins

Bump Mapping (Blinn 1978)Bump Mapping (Blinn 1978)

• Texture maps ~ diffuse reflectance:Texture maps ~ diffuse reflectance: no lighting or viewing dependence no lighting or viewing dependence

• ‘‘Flat’ appearance; can we suggest shape?Flat’ appearance; can we suggest shape?• Bump map: Bump map:

texel value texel value surface normal changes surface normal changes• Make bump map:Make bump map:

– make a 2D height field in u,v spacemake a 2D height field in u,v space– find, store find, store surface normal vec. at each u,v texel surface normal vec. at each u,v texel

• Use bump map:Use bump map:– surface normal (phong shading, etc) = surface normal (phong shading, etc) =

polygon normal + polygon normal + bump map normal bump map normal– variants: use for lighting normal, ‘embossing’, EMBM, variants: use for lighting normal, ‘embossing’, EMBM,

visibility & self-shadowing(Nelson Max, 1999)., etc.visibility & self-shadowing(Nelson Max, 1999)., etc.

Bump MappingBump Mapping

• Texels displace Surface NormalsTexels displace Surface Normals

• Many clever, simpler (cheaper) variants...Many clever, simpler (cheaper) variants...

Image Credit: NVidia Corp: GeForce 3 DemoImage Credit: NVidia Corp: GeForce 3 Demo

Bump Mapping (Blinn 1978)Bump Mapping (Blinn 1978)

• Works well everywhere except silhouettesWorks well everywhere except silhouettes

• No self-shadowing (but see Nelson Max99)No self-shadowing (but see Nelson Max99)

• Complex hardware req’d forced many early Complex hardware req’d forced many early approximations (Embossing, EMBM, etc.)approximations (Embossing, EMBM, etc.)

Displacement Maps: ‘True’ geometry modsDisplacement Maps: ‘True’ geometry mods

• Requires micropoly shaders(Renderman)Requires micropoly shaders(Renderman)• VERY powerful high-end modeling tool VERY powerful high-end modeling tool

(lighbulb filament and screw base)(lighbulb filament and screw base)

Displacement Maps, Displacement Maps, Shading LanguagesShading Languages

• Famous early Pixar resultFamous early Pixar resultREYESREYESRenderman Renderman – photo-based environment mapphoto-based environment map– dicing,micropolygonsdicing,micropolygons– shader language shader language – displacement mapsdisplacement maps– StochasticStochastic

antialiasing antialiasing (with motion blur)(with motion blur)

Mental Ray Mental Ray displacement shader 1998displacement shader 1998

Environment MapsEnvironment Maps

How can I use texture maps for shiny things that move in real time?

Answer: make a

texture map for the

the incoming light,

not the surface itself

Environment MapsEnvironment Maps

• ‘‘World-in-a-box’: texel == light src. at infinityWorld-in-a-box’: texel == light src. at infinity– Fast, simple, looks good on flying chrome logosFast, simple, looks good on flying chrome logos– Complex lighting environments in real time...Complex lighting environments in real time...– Limits: bad on flat surfaces, no interreflections, Limits: bad on flat surfaces, no interreflections,

no self-shadowingno self-shadowing

Environment Environment MapMap

A ‘Box’ of images A ‘Box’ of images – Can use Photos or ray-tracing Can use Photos or ray-tracing

– all 6 images use the same all 6 images use the same Center-of-Projection Center-of-Projection

pointpoint

– one texel == light from one directionone texel == light from one direction

Environment MapsEnvironment Maps

Result:– Curved surfaces are best– Flat surfaces:

same normalsame color

OpenGL: Spherical Environ. MapsOpenGL: Spherical Environ. Maps

– More Efficient than cube mapsMore Efficient than cube maps– texture map == texture map ==

image of perfect sphere reflectorimage of perfect sphere reflectorseen from infinity (orthographic)seen from infinity (orthographic)

OpenGL: Spherical Environ. MapsOpenGL: Spherical Environ. Maps

• ExampleExample

““Mirror Ball”-like imageMirror Ball”-like image Env. Mapped Env. Mapped resultresult

Light MapsLight Maps

• ‘‘Multi-texturing’ idea: Multi-texturing’ idea: arbitrary texel-by-texel arbitrary texel-by-texel shading calc’d from multiple texture mapsshading calc’d from multiple texture maps

ReflectanceReflectance

TextureTexture Light MapLight Map(Illumination Texture)(Illumination Texture)

= Display texture= Display texture

Light MapsLight Maps

• ‘‘Multi-texturing’ idea: Multi-texturing’ idea: pre-render special lighting effectspre-render special lighting effects

ReflectanceReflectance

TextureTexture Light MapLight Map(Illumination Texture)(Illumination Texture)

= Display texture= Display texture

Advanced TopicsAdvanced Topics

• Continuum: ‘geometry’ vs ‘texture, material’Continuum: ‘geometry’ vs ‘texture, material’– microstructure of surface, self-shadowing, etc microstructure of surface, self-shadowing, etc

determines surface appearancedetermines surface appearance– ““Surface” is scale-defined: carpet?yarn?fiber? Surface” is scale-defined: carpet?yarn?fiber?

• Surface Mappings for volumes:Surface Mappings for volumes:– Lengyel 2000: approximating fur, hair,...Lengyel 2000: approximating fur, hair,...– BTF synthesis, volumetric texturesBTF synthesis, volumetric textures

• Generalized Surface MappingGeneralized Surface Mapping– Hypertextures, turbulence functions(Perlin85+)Hypertextures, turbulence functions(Perlin85+)– Texture Synthesis on Surfaces (Turk2001,...)Texture Synthesis on Surfaces (Turk2001,...)

Turk: Diffusion, Texture SynthesisTurk: Diffusion, Texture Synthesis

• Diffuse outwards from seed vectors Diffuse outwards from seed vectors to build a smooth (u,v) mapto build a smooth (u,v) map

• Works on any shape (any topology)Works on any shape (any topology)

Greg Turk, Ga Tech

Lengyel: Texture-based Fur, HairLengyel: Texture-based Fur, Hair

• Semi-transparent layers of hair imagesSemi-transparent layers of hair images• ‘‘Fins’ for silhouette hairsFins’ for silhouette hairs• Real-Time Display, movementReal-Time Display, movement

Jed Lengyel, MS ResearchSIGGRAPH2000

Merging with Other AreasMerging with Other Areas

• Image-Based Modeling and RenderingImage-Based Modeling and Rendering

• Real-time Visibility (billboards—see book)Real-time Visibility (billboards—see book)

• Texture SynthesisTexture Synthesis

• Procedural ModelingProcedural Modeling

Even the image/geometry line is blurring:Even the image/geometry line is blurring:– if we put a vertex at each texel, if we put a vertex at each texel,

is it still a texture map?is it still a texture map?– if an image holds positions of a mesh?if an image holds positions of a mesh?