Hi All,
I had a potentially cool idea for a bumpmap shader, but not the time
to implement it. So I thought I'd throw it on the list incase someone
else felt inclined to write it.
It'd be a "two pass" shader - lightmap functionality could probably do
the trick. Short of it is lightmap the bump texture into a kdtree -
I'd suggest using adaptive subdivision of each triangle (i.e. doing
multiple point on the triangle dependent on it's size in screen
space). You store the data at the actual surface position in the
kdtree. The data you store would be dependent on which approach you
want to take here. Each has a tradeoff - you could store just the
"displaced" point position and the normal of the original point. i.e.
as though you used the bump texture as a displacement map, or you
could store the normal and the bump texture value (height value).
Using the height value will require additional computation at
rendertime, but reduces memory usage.
Then at rendertime you lookup the kdtree - again I'd suggest using a
screen space based radius. Filter out any points returned where the
normal's dot product with the normal of the point you used for the
search is less than 0 (i.e. those facing away from it).
Then get the displaced positions for all the points you've collected
(if you've stored texture values instead you'll need to compute it
from the position + normal*height). Then run a best fit plane
algorithm over it. You'll need to find a really efficient
implementation of this to make the shader practical - Halfy gave me
this link which has one http://www.cgal.org/
That plane will give you the new normal for that position.
Anyway - if someone does have the time/inclination to do it I'm happy
to compile the linux versions for them.
Cheers,
Alan.
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi