Sign in to follow this  
mmikkelsen

Procedural Bump Mapping on the GPU

Recommended Posts

mmikkelsen    236
I wrote a technical paper I would like to share with all of you. In Renderman it is possible to pull a height value out of thin air and use it freely to perturb the normal to achieve bump mapping. This allows users of Renderman to composite scalar functions/textures defined on domains of arbitrary dimension (for instance 4D) and thus perturb the normal. This ability has been considered to be impossible on the GPU (in a single pass). My paper addresses several issues but this is one of them. Essentially, a method is presented which takes as input: surface position, surface normal and height value. From these three inputs the perturbed normal is returned. Thus no tangent space is needed and it gives a uniform solution that will work for any kind of surface: Polygonal Meshes, Curved Surfaces, any kind of Mesh deformation, Blendshapes, Isosurfaces, etc. The method also reduces memory footprint for regular textures since height textures compress well using DXT5 alpha format which is 4 bits per pixel. (Better than normal maps in DXT1) The paper is called: "Bump Mapping Unparametrized Surfaces on the GPU" and is available here jbit.net/~sparky/sfgrad_bump/mm_sfgrad_bump.pdf There are also various screen shots and movies available using the methods described in the paper at the following locations: jbit.net/~sparky/sfgrad_bump/ jbit.net/~sparky/sfgrad_bump/displacement/ Enjoy! :)

Share this post


Link to post
Share on other sites
Rompa    307
Morten, thanks to you (and Naughty Dog) for sharing this.
Quote:
The method also reduces memory footprint for regular textures since
height textures compress well using DXT5 alpha format which is 4 bits per pixel.
(Better than normal maps in DXT1)
I'm pretty sure DXT5 is 8 bits per pixel... or are you referring to the encoding of the alpha bits only within DXT5 being encoded in 4 bits for every pixel?

Share this post


Link to post
Share on other sites
mmikkelsen    236
Thanks for the reply :)

I was thinking the BC4 format or using the alpha component of a DXT5
in which RGB is used for something else. Either case would yield 4 bits per pixel for the height map.

On a different note. For those who intend to do proceduralism with this you
will need to do filtered sampling of your procedural function. Frequency clamping is typically used for noise based compositions and this works on the GPU as well.
I recommend using the implementations in the book "Advanced Renderman". I got very good results using them and they are very easy to port to the GPU.

The area function used in renderman gives you the area of the microfacet which is conceptually the surface area (in shader space) covered by the current pixel.
This is trivially evaluated on the GPU using ddx and ddy and is in fact better because we get a continuous transition of the estimate across the primitive.

For noise I use the implementation in GPU Gems2. In addition to this I wrote a function that evaluates exact/analytic gradient of the noise function.
This is for the method in listing 2 which does not use ddx and ddy.

If anyone needs help with any of this let me know.

Cheers,

Morten.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this