Presentation is loading. Please wait.

Presentation is loading. Please wait.

BUMP-MAPPING SET09115 Intro to Graphics Programming.

Similar presentations


Presentation on theme: "BUMP-MAPPING SET09115 Intro to Graphics Programming."— Presentation transcript:

1 BUMP-MAPPING SET09115 Intro to Graphics Programming

2 Breakdown  Background  Review – texturing and lighting  Adding detail  Bump and Normal Mapping  Examples  Shaders  Advanced Techniques  Parallax mapping  Tessellation

3 Recommended Reading  Real-Time Rendering  Chapter 6, section 6.7 onwards  For tessellation, see 13.6

4 Background

5 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

6 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

7 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?

8 Solution – Add Geometry  Easy solution – add more triangles  Artist’s solution  More triangles means more geometry means higher quality  So job done, right?

9 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?

10 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

11 Options  Bump Mapping  Normal Mapping  Relief Mapping  Parallax Mapping

12 Questions?

13 Bump and Normal Mapping

14 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

15 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

16 Video Example  http://www.youtube.com/watch?v=HR422RXjw-Q http://www.youtube.com/watch?v=HR422RXjw-Q

17 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

18 Normal Mapping  Normal mapping extends on the bump mapping technique to create a more shaped detail  Think brick work rather than low level surface

19 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

20 Video Example  http://www.youtube.com/watch?v=pQS2m18ebEI http://www.youtube.com/watch?v=pQS2m18ebEI

21 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

22 Questions?

23 Advanced Techniques

24 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

25 Relief Map Example  http://www.youtube.com/watch?v=5gorm90TXJM http://www.youtube.com/watch?v=5gorm90TXJM

26 Parallax Mapping  AKA virtual displacement mapping  Uses the viewer position to retrieve different pixels from the texture based on the height field

27 Video Example  http://www.youtube.com/watch?v=R4vIQobnegk http://www.youtube.com/watch?v=R4vIQobnegk

28 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

29 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

30 Video Example  http://www.youtube.com/watch?v=-uavLefzDuQ http://www.youtube.com/watch?v=-uavLefzDuQ

31 Questions?

32 To do this week…  Practical this week is on texturing  I need to tweak the one on WebCT a little  I know 3 rd 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

33 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


Download ppt "BUMP-MAPPING SET09115 Intro to Graphics Programming."

Similar presentations


Ads by Google