[D3D11] Normal Mapping

Started by
7 comments, last by nbertoa 11 years, 2 months ago

Hi community. I finished a new demo about normal mapping using DirectX 11.

DESCRIPTION:
When we apply a brick texture to a cone shaped column, the specular
highlights looks unnaturally smooth compared to the bumpiness of the
brick texture. This is because the underlying mesh geometry is smooth,
and we have merely applied the image of bumpy bricks over the smooth
cylindrical surface. However, the lighting calculations are performed
based on the mesh geometry (in particular the interpolated vertex
normals), and not the texture image. Thus the lighting is not completely
consistent with the texture.

The strategy of normal mapping is to texture our polygons with normal
maps. We then have per-pixel normals which capture the fine details of a
surface like bumps, scratches and crevices. We then use these per-pixel
normals from the normal map in our lighting calculations, instead of
the interpolated vertex normal.

A normal map is a texture, but instead of storing RGB data at each texel,
we store a compressed x-coordinate, y-coordinate and z-coordinate in
the red component, green component, and blue component, respectively.
These coordinates define a normal vector, thus a normal map stores a
normal vector at each pixel.

To generate normal maps we can use a NVIDIA Photoshop Plugin or CrazyBump software.

The coordinates of the normals in a normal map are relative to the
texture space coordinate system. Consequently, to do lighting
calculations, we need to transform the normal from the texture space to
the world space so that the lights and normals are in the same
coordinate system. The TBN-bases (Tangent, Bitangent, Normal) built at
each vertex facilitates the transformation from texture space to world
space.

BIBLIOGRAPHY:
Introduction to 3D Game programming using DirectX 11.
Real Time Rendering

VIDEO DEMONSTRATION:

">


SOURCE CODE:
http://code.google.com/p/dx11/
Advertisement

Are you going to attempt to do tessellation or displacement mapping?

Hi riuthamus.

Yes! In my next mini project I will apply displacement mapping to this scene.

Def worth checking out than. We are looking at doing this but have 0 ideas on how to mess with tessellation+dx11

I will send you a private msg when I post that demo.

Currently I am reading Real Time Rendering and Introduction to 3D Game Programming with DirectX 11.

I learned about Tessellation in DirectX11 reading Microsoft Documentation and DirectX SDK.

@Nikko: it looks great - nice work on the video. I'm looking forward to seeing the next one!

@riuthamus: There is also a displacement mapping implementation in Hieroglyph 3 - check out the SkinAndBones sample.

@Nikko: it looks great - nice work on the video. I'm looking forward to seeing the next one!

@riuthamus: There is also a displacement mapping implementation in Hieroglyph 3 - check out the SkinAndBones sample.

Thanks for the link but we are using our own engine and would need to code that part in ourselves. On top of that our tessellation would need to be utilized with a server physics mesh ( which is another problem we will have to tackle at some point! ) What you linked looks very good though.

Thanks Jason Z, I think it will be finished for tomorrow :)

Hi guys. Finally I posted Displacement Mapping project.

This is the link

http://www.gamedev.net/topic/638668-d3d11-displacement-mapping/

This topic is closed to new replies.

Advertisement