+ All Categories
Home > Documents > Bump-Mapping

Bump-Mapping

Date post: 23-Feb-2016
Category:
Upload: tawny
View: 35 times
Download: 0 times
Share this document with a friend
Description:
Bump-Mapping. SET09115 Intro to Graphics Programming. Breakdown. Background Review – texturing and lighting Adding detail Bump and Normal Mapping Examples Shaders Advanced Techniques Parallax mapping Tessellation. Recommended Reading. Real-Time Rendering - PowerPoint PPT Presentation
Popular Tags:
33
BUMP-MAPPING SET09115 Intro to Graphics Programming
Transcript
Page 1: Bump-Mapping

BUMP-MAPPINGSET09115 Intro to Graphics Programming

Page 2: Bump-Mapping

Breakdown Background

Review – texturing and lighting Adding detail

Bump and Normal Mapping Examples Shaders

Advanced Techniques Parallax mapping Tessellation

Page 3: Bump-Mapping

Recommended Reading Real-Time Rendering

Chapter 6, section 6.7 onwards For tessellation, see 13.6

Page 4: Bump-Mapping

Background

Page 5: Bump-Mapping

Review - Lighting Lighting is the technique we use to

provide depth to our renders Three basic lighting types

Ambient Background light

Diffuse Directional light

Specular Shininess

Page 6: Bump-Mapping

Review - Textures Textures are just a 2D grid of pixels we

can use for other purposes For examples, alpha-mapping

We can use texture data in our shaders to perform more elaborate effects

Using texture data is one of the commonest techniques for adding more detail to a 3D model

Page 7: Bump-Mapping

Problem – Adding Detail We want detail

The more detail the better How do we get high detail renders in our

game so we can see creases in fingers, notches in swords, etc?

Page 8: Bump-Mapping

Solution – Add Geometry Easy solution –

add more triangles Artist’s solution

More triangles means more geometry means higher quality So job done,

right?

Page 9: Bump-Mapping

Problem – Processing Geometry

Problem is processing high poly count models Typically try and keep characters down to

25,000 High number of triangles means it takes

longer to render Fine for non-real-time applications Games we need better techniques

So how do we add detail, without adding geometry?

Page 10: Bump-Mapping

Cheating with Lighting Effectively, we have

already been doing this Lighting cheats Phong shading is an

example We need techniques

which allow us to manipulate the light to make it look like there is detail

Page 11: Bump-Mapping

Options Bump Mapping Normal Mapping Relief Mapping Parallax Mapping

Page 12: Bump-Mapping

Questions?

Page 13: Bump-Mapping

Bump and Normal Mapping

Page 14: Bump-Mapping

Bump Mapping Bump mapping is the technique used to

add detail to a surface Think roughness / texture

Bump mapping is the simplest technique for adding detail using textures

Page 15: Bump-Mapping

Bump Map A bump map is

just a black and white image that is used to modify the surface a model to provide a rough look Detail is very fine,

surface level Think cloth

texture

Page 16: Bump-Mapping

Video Example http://www.youtube.com/watch?v=HR42

2RXjw-Q

Page 17: Bump-Mapping

Procedural Bump Mapping Frag Shader

vec3 litColour;vec2 c = BumpDensity * TexCoord.st;vec2 p = fract(c) – vec2(0.5);float d, f;d = dot(p, p);f = inversesqrt(d + 1.0);if (d >= BumpSize) { p = vec2(0, 0); f = 1.0; }vec3 normDelta = vec3(p.x, p.y, 1.0) * f;litColour = SurfaceColour.rgb * max(dot(normDelta, LightDir), 0.0);vec3 reflectDir = reflect(LightDir, normDelta);// Use reflectDir as relection normal

Page 18: Bump-Mapping

Normal Mapping Normal mapping

extends on the bump mapping technique to create a more shaped detail Think brick work

rather than low level surface

Page 19: Bump-Mapping

Normal Maps Normal maps use

RGB as their texture colours

Depending on the colour, the lighting model determines the normal of the model at that particular point of the texture

Page 20: Bump-Mapping

Video Example http://www.youtube.com/watch?v=pQS2

m18ebEI

Page 21: Bump-Mapping

Normal Mapping Shader Normal mapping shader works similarly

to the bump mapping shader Typically, we add specularity as well Main difference is that our normals are

more than two values, allowing a more realistic lighting effect

Page 22: Bump-Mapping

Questions?

Page 23: Bump-Mapping

Advanced Techniques

Page 24: Bump-Mapping

Relief Mapping Relief mapping is where we add detail

using a texture, but actually manipulate the geometry to create the detail

Actually, we talked a bit about relief mapping for terrain generation last week We are manipulating a 3D plane into our 3D

terrain Relief mapping is useful, but more

expensive

Page 25: Bump-Mapping

Relief Map Example http://www.youtube.com/watch?v=5gor

m90TXJM

Page 26: Bump-Mapping

Parallax Mapping AKA virtual

displacement mapping

Uses the viewer position to retrieve different pixels from the texture based on the height field

Page 27: Bump-Mapping

Video Example http://www.youtube.com/watch?v=R4vIQ

obnegk

Page 28: Bump-Mapping

Displacement Mapping Essentially relief

mapping Proper relief

mapping has the ability for self-occlusion and self-shadowing

Technique requires geometry to be added to a model Tessellation

Page 29: Bump-Mapping

Tessellation The big new addition

to DirectX 11 Triangles are added or

removed based on how close the viewer is Think like mip-

mapping, but for models

Not like normal LOD where different models are used

Page 30: Bump-Mapping

Video Example http://www.youtube.com/watch?v=-uavL

efzDuQ

Page 31: Bump-Mapping

Questions?

Page 32: Bump-Mapping

To do this week… Practical this week is on texturing

I need to tweak the one on WebCT a little I know 3rd years have MAD CW due this

week Get it out of the way so you can move onto

this one I won’t be producing a practical on bump

mapping If interested, investigate yourself

Page 33: Bump-Mapping

Summary Adding details to a render is where

current game technology is focused Model complexity can’t go much further on

current generation hardware Various techniques allow us to modify a

render to provide detail Bump mapping, normal mapping, etc.

There is a cost, but usually less than adding geometry


Recommended