Paper Summaries

• Any takers?

Logistics One more announcement

• Job related news • Electronic Arts (EA) is coming to RIT. – Co-op orientation – Looking for a few (actually more than a few) good gaming programmers • Friday, Sept 16th 12:00 – 1:30pm 70-1400 • Friday, Oct 14th 1:00 – 2:30pm Eastman Aud. – EA Company Presentation – Career Fair • Tuesday, October 4th • Wednesday, Sept 28th • 6-7:30pm • 11am – 4pm • Golisano auditorium • Gordon Field House – Interviews th – EA Job offer • Wednesday, October 5 (Career Center) • SIGN UP IF INTERESTED!!!

Assignments Projects

• Checkpoint 2 • Approx 17 projects – Due today. • Listing of projects now on Web • Checkpoint 3 • Presentation schedule – Due Thursday – Presentations (20 min max) – Roundoff error! – Last 3 classes (week 10 + finals week) – Sign up • Checkpoint 4 / RenderMan • Email me with 1st , 2nd , 3rd choices – To be given Thursday • First come first served.

1 as Virtual Photography Remember this?

real camera photo Photographic Photography: scene (captures processing print light) • Bi-directional Reflectance Function

processing

BRDF = fr (φi ,θi ,φr ,θ r ) Computer 3D camera tone synthetic Graphics: models model reproduction image At a given point, gives relative reflected illumination in any (focuses simulated direction with respect to incoming illumination coming from lighting) any direction

Illumination Models Phong Model

• 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. = + • + • ke L(V ) ka La kd ∑i Li (Si N) ks ∑i Li (Ri V) ambient diffuse specular

Question Texture Mapping

• What if Phong (or other) Illumination models aren’t good enough? • Developed in 1974 by Ed Catmull, currently – Texture Mapping – use an image president of Pixar – Procedural Shading – program your own • Goal: Make Phong shading less plastic looking

2 Texture Mapping 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)

Watt

Texture Mapping Texture Mapping

• Key to texture mapping is parameterization texture space (u,v) – 3D geometry must be expressed as a function parameterization of 2 variables, u and v.

–Examples: object space (xo,yo, zo) •Planar projection • Spherical • Bi-cubic patch screen space (x,y) • Cylindrical

Texture pipeline Texture pipeline example

Akenine-Moller / Haines

Akenine-Moller / Haines

3 Projector function Projector function

• Converts 3D point in object space (x,y,z) to • Spherical Mapping 2D point in texture parameter space (u,v) •Examples: – Spherical mapping – Cylindrical mapping – Planar mapping – Parametric surface mapping

Projector function – Spherical Mapping Projector function

• Cylindrical mapping

Texture is like a rubber sheet stretched to fit model

Projector function Projector function

• Spherical mapping • Bi-cubic surfaces

4 Projector function – bicubic surfaces Projector function

• Texture Mapping Applets http://www.cs.brown.edu/exploratories/free Software/catalogs/texture_mapping.html

Watt

Corresponder function Texture Mapping - Direct Mapping

• 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 – Using a Texture Mapping – Applying Transformation Portion of the Image

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

Foley/VanDam(745)

5 Texture Mapping – out of range Texture mapping

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

Repeat Mirror clamp border (tile) (tile)

Texture mapping

• Aliasing- point sampling in middle of pixel - need more! Texture Mapping – Aliasing

Watt

Texture Mapping Texture Mapping - Anti-aliasing

• Aliasing -because of interpolation and perspective • Point sample at higher resolution (sometimes very projection 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 aliased image anti-aliased image • Can sometimes use stochastic sampling to improve results

6 Texture mapping Texture Mapping

• Texture Map Aliasing Applet •Mipmaps http://www.nbb.cornell.edu/neurobio/land/ – Pre-calculate your texture map at many resolutions (or layers) OldStudentProjects/cs490- – Store all “texture layers” in a single image. 96to97/anson/TextureMappingApplet/ – 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 Texture Mapping

•Mipmaps

Texture pipeline When we last left our hero

• Break

7 Value transform function Value Transform functions

• Texture maps need not be just plain old • Texel data interpretation: RGB. – Normal displacement – • Texture == data associated with an object – Transparency Mask – Alpha Mapping – Stored in a 2D array of texels – Reflection – Environment Mapping • Value transform function – Illumination – Light Mapping – Transforms data into value usable by the – Specular component – Gloss Mapping illumination model at the shading point – Lighting intensities – Radiance Mapping

Texture Mapping- Bump Mapping Texture Mapping- Bump Mapping • Perturbing surface normal ƒ Adds roughness to surfaces • Texture map represents displacements from the ƒ Quick way to add detail to an normal object • Use perturbed normal in illumination model ƒ Polygon remains physically flat, but appears bumpy

Jim Blinn

Texture mapping – Bump Mapping Bump Mapping Theory • If your eyes see light and dark Æ bumps • Flat surfaces reflect more light • Bumpy surfaces reflect less

8 Bump Mapping-Theory Bump Mapping • Perlin Dnoise example

[Perlin85] Normal += Dnoise (point)

Texture Mapping Alpha Mapping

• Bump Mapping • Used to control the transparency. • Example:

3dimpact.com

Texture Mapping- Environment mapping Texture Mapping- Environment mapping

• Create an image, representing the reflection of the • Not associated with a particular object but with world onto an object an imaginary surface surrounding the scene • Use surrounding sphere or box, image is texture map – Specular Reflection – indexed by reflected ray indexed by direction of reflection ray – Diffuse - by surface normal • Poor-man’s ray tracing - cheaper – Transparency – refracted ray direction

9 Environment Mapping Environment Mapping

spherical Cube map

Texture Mapping Texture mapping • Environment mapping

Light Mapping Gloss Mapping

• Texture map that describes illumination • The texture that controls the specular (light sources)to apply reflection color. • Modulates the the specular reflection and the environment map. •Demo

flipcode.com

10 Texture Mapping Texture Mapping – Radiance Maps

• Static • Provides approximated radiance values, not – Texture map image is taken under a single simply color info, as a texture. lighting condition • Radiance map not only for the distant scene, but in reflections from objects. – Q: What happens when lighting conditions of • Radiance in map used in global illumination the scene doesn’t match that of your texture? solution – A: let’s go to the video tape • Technique used in Fiat Lux

Texture pipeline Layered Texture Mapping

• Finally obtained data is applied in illumination equation.

Layered Texture Mapping Multipass Texture Rendering

• Applet • Multiple textures for multiple parts of http://users.interfriends.net/maurid/Bump illumination model rendered on multiple Mapping.htm passes. • Modern hardware supports up to 10 passes on a single frame.

11 Multipass Texture Render Summary

• Quake III Engine • Texturing Pipeline – Passes 1-4: accumulating bump map • Advantages of texture mapping – Pass 5: diffuse lighting – Easy way to add complexity to a scene – Pass 6: base texture – Hardware support – Pass 7: Specular • Issues: – Pass 8: emissive lighting – Aliasing – Pass 9: volumetric effects – Limited resolution (zoom in DOOM effect) – Pass 10: screen flashes – Static image

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?

12