Jump to content
  • Advertisement
Sign in to follow this  
Prune

Self-shadowing of clumpy fur

This topic is 3499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!