Spherical HeightField Lighting

This is more of an exploratory question than a query about specific techniques:

Can anyone think of a method to light a dynamically-created spherical height-field? By ‘spherical height-field’ I mean one whereby a spherical mesh is created using a ‘geometry image’, and the radius of the sphere is modulated across the surface to create a distorted sphere shape. I’ve seen a number of techniques to light planar height-fields by creating normal maps from the displacement image, but I don’t thing these can be applied to a modulated spherical height-field.

Anyone seen this done, or have any thoughts on how it might be achieved?

I had a stab at it once before, but was never that pleased with the results. I’m kinda surprised it worked at all, to be honest, bearing in mind that I simply used a normalmap created by applying a sobel filter to the displacement map, without doing any kind of transformation on it to get it into the right space in the fragment shader.
http://machinesdontcare.wordpress.com/2008/05/22/radial-vdm-sobel-normalmap/

a|x
http://machinesdontcare.wordpress.com

You are correct: sobel filtering a spherical height map produces an incorrect normal map. You end up with flattened-looking poles. I’ve encountered this while producing a normal map of the earth from a terrain map. Of course, you don’t really notice on the earth because the poles are quite flat already, and this is a mistake that many people aren’t aware they’re making. But clearly you’re not rendering the earth.

I ended up writing my own filter tool which non-uniformly scaled the filter kernel based upon an awareness of the non-uniformity of the texture space. I’m afraid I don’t have any code that I could give you, nor am I aware of an off-the-shelf tool to do the same thing.

Hi rlk,

thanks for getting back to me.
I’m definitely not rendering the Earth! I guess because the shape is so extreme, any errors that you might be able to get away with with much less radically-distorted geometry become more of an issue.

Thanks for the feedback,

a|x

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.