HLSL & bumpmapping
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 :)
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...
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?
Can someone explain me how this works?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement