HLSL & bumpmapping

Started by
4 comments, last by genesys 18 years, 6 months ago
hi! I know how to create bumpmapping from an RGB normalmap in an HLSL shader - that's quite easy... But how do i use a grayscale map to create a bump effect? Or how do i convert from grayscale highinformation to RGB noraml information in the shader itself? I know how to convert a grayscale bumpmap to an RGB normalmap in photoshop - but that doesn't help me in that case because i'm using a black/white 3dvolume DDS map... so i must do the conversion in the shader. Thx :)
Advertisement
Try using D3DXComputeNormalMap. This function can take a grayscale texture and create a normal map texture from it.
hum . . . but i can't imagine how this shold work with a Volume map - because the D3DXComputeNormalMap is performed before the HLSL shader uses the map - and i don't think a 3D volume normalmap can exist.... so you must create the normalmap after you textured the object with the 3d grayscale map i think...
there shouldnt be a problem with doing it in the shader.
you can do multiple texture lookups on the height map and calculate the normal from that heights.
i never tried it though...
rendermonkey has got a example file called normalmap filter, which does this... i could just copy the code and try to get it to work, but i'd like to understand the logic behind it!

Can someone explain me how this works?
btw.

I heard that there are a lot of different ways to do bumpmapping with grayscale textures . . . Some of them are better for performance - even without pixelshading - just by using different passes...


Someone's got some informations?

This topic is closed to new replies.

Advertisement