Sign in to follow this  
Prune

Self-shadowing of clumpy fur

Recommended Posts

Prune    224
I'm doing fur with the shells method. In http://www.gamasutra.com/php-bin/news_index.php?story=7016 the self-shadowing calculation leaves the tips lit and transitions to shaded over a short interval that starts at a point along the hair normal that is proportional to the density (and light angle). However, the density is assumed uniform. I have clumpy fur instead, where groups of hairs form sort of tufts. I can estimate the density by looking up a couple mip levels deeper into the fur texture and taking the alpha (not sure whether texture2D or texture2DLod or texture2DGrad is more correct here? I guess the goal is that the calculation should be screen-scale independent), and that's an improvement, but still doesn't really give the correct look, since the outsides of tufts are lit more than the insides. Checking the gradient magnitude by a central difference (1 pixel each way) of neighboring pixels in the lower mip level can tell me which hair pixels are near the outside of clumps, but I can't simply shadow them all less, since that won't take into account shadowing by the tuft itself. It seems to me what I need is to lighten specifically those with a negative derivative in (lower mip level) texture space along the light vector's projection onto texture space. But how do I get this projection? (I already have a tangent basis)

Share this post


Link to post
Share on other sites
_Lopez    142
Have you had a look at relief mapping with soft self-shadows? Briefly, the process involves ray-marching the texture in tangent space, along the light vector (also in tangent space) in a while loop. I'm at work now, so no examples, but you should ffindd some papers by googling. Hope that helps.

Share this post


Link to post
Share on other sites
Prune    224
I've seen that, but the difference is that here I have 16 to 24 layers of hair textures that form a volume rendering through alpha blending. It's quite a different technique.

Anyway, I managed to get my idea to work.

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