questions about hair rendering

Practical and theoretical implementation discussion.
Post Reply
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

questions about hair rendering

Post by MohamedSakr » Thu Aug 21, 2014 3:01 am

I want to implement hair rendering, but don't know where to start from
if there are some good papers about this topic this would be appreciated

some questions though:
1- which is better(storing hairs as splines or as triangles) "for memory usage and speed, how it may suit GPU"
2- how it would be integrated in SBVH
3- a fast and method to estimate direct illumination on hair "if there is 1 for indirect this would be appreciated also :) "

Posts: 8
Joined: Wed Aug 20, 2014 6:56 am

Re: questions about hair rendering

Post by joulsoun » Thu Aug 21, 2014 10:32 am

Kind of on this topic, I remembered this poster from Siggraph 2012 about very efficient sampling of hair. Not exactly your fit, but a very interesting read nonetheless! ... stract.pdf

Posts: 46
Joined: Fri Jun 21, 2013 10:02 am

Re: questions about hair rendering

Post by papaboo » Fri Aug 22, 2014 6:37 am

Disclaimer: I haven't read any of the source code or played around with it, so I don't know how well it works. But!

I would take a look at Embree. A lot of their 2.x.y relaese notes are concerned with hair, so clearly the guys have invested time in solving this issue. You might need to tweak their solution a bit in order to fit it onto a GPU, but Embree is written for SIMD architectures, so I'm guessing it shouldn't be too much of an effort.

Posts: 20
Joined: Fri Jun 22, 2012 6:48 pm

Re: questions about hair rendering

Post by sriravic » Fri Aug 22, 2014 12:10 pm


With regards to hair rendering, using curves directly over tessellation has its own advantages and disadvantages.

1. Reduced memory consumption. Typically curves are modelled as splines or bezier curves which are just a bunch of control vertices. Hence we use very less memory compared to tessellating the curves and storing per triangle vertices. The savings can actually be very very large if the tessellation rates are very high (used to accurately represent curves with triangles). Using the curve form naturally provides high quality curves and hair quality is determined only by ray sampling rate and not tessellation rate.
2. On the flip side, ray curve intersection tests are costly compared to triangle tests. You can look at the recent implementation we did with appleseed renderer ( ... iercurve.h) which supports degree 1,2,3 bezier curves as of now.
3. Using SBVH with curves directly is a bit tricky though. If you were to tessellate the curves, then its straightforward to feed the resulting triangles into the SBVH tree. No changes are required. But the tree can become very large due to a large number of triangles (once again memory issues). But using curves directly within a bvh (not sbvh) is straight forward as you use individual curves for primitives and their BVHs. But defining a spatial split with curves would be tricky I guess (we've already added bvh support for curves in appleseed and it works very good I guess). We are yet to understand how SBVH would fit with curves. Another issue is that when using curves, you end up having two different hierarchies to traverse (one for triangles and one for curves). This is another issue that has to be solved (there is a good paper from Intel in this year's HPG that talks about how to construct better BVH for hair using hair similarity) which is integrated in embree. Sadly the code available is only for Xeon Phi architecture and not for CPUs.

4. For illumination which should be fast I guess Kay-Kajiya model should work fine. But the industry standard is the Marschener model I guess. I'll have to look further into it I suppose.


Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

Re: questions about hair rendering

Post by MohamedSakr » Fri Aug 22, 2014 6:07 pm

@joulson thanks for the link, I took a look and it looks sweet :)

@papaboo I remember that embree has good hair tracing algorithm, but I forgot why I didn't use it, after reading sriravic reply I remembered now "because it is only for written for Xeon Phi"

@sriravic thanks a lot for the reply and the link, I'm interested to know the factor of computation of "ray-curve vs ray-triangle intersections"
also did you try other accelaration structures? "like OcTree?"

Posts: 1
Joined: Sat Aug 23, 2014 9:31 am

Re: questions about hair rendering

Post by manycores » Sun Aug 24, 2014 7:46 am

The hair geometry traversal/intersection code in Embree is written for *both* standard CPUs (SSE/AVX/AVX2) and Xeon Phi ;)

Post Reply