Page **1** of **2**

### Hair intersection : approaches ?

Posted: **Tue Feb 11, 2014 11:52 am**

by **spectral**

Hi,

I'm currently looking for all the different approaches of "hair intersection".

So, if you have papers, documentation, reference or anything else... please drop me a line

Any council, comment, feedback is also welcomed....

BTW: I have to implement it on the GPU (I'm just afraid of analytic code ... that can be slow !!!)

Thx

### Re: Hair intersection : approaches ?

Posted: **Wed Feb 12, 2014 12:05 pm**

by **papaboo**

There's the stochastic transparency approach to transparency.

http://www.nvidia.com/object/nvidia_res ... b_016.html
But if you're targeting real-time rendering I don't know if you want a random element in your renderer which could potentially produce artefacts in certain scenarios.

### Re: Hair intersection : approaches ?

Posted: **Wed Feb 12, 2014 1:30 pm**

by **spectral**

Thanks, but I don't care about shading... just

*intersections* for now

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 1:53 am**

by **Chris Morris**

Very hard thing to do without cheating (biased tricks). I'd think you would have to evaluate the hairs at the node procedurally from a set of constraints and control points, rather than intersecting some kind of primitive soup. When your ray hits a constraint node, find the nearest set of control points that represent that chunk of hair and test against the set of splines created from the local control points and a procedural offset that define each individual hair.

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 10:09 am**

by **Dade**

Having another ray/primitive intersection, aside from ray/triangle, is particularly GPU-unfriendly. In LuxRender, we use a simple open standard file format to fast export/import (

http://www.cemyuksel.com/research/hairmodels/) hair/strand information. It is also quite efficient in term of disk space. We than tessellate the hairs in triangles with few options available for the users (solid or ribbons, adaptive tessellation, resolution, etc.). It works quite well:

- furball.jpg (173.34 KiB) Viewed 8420 times

Indeed, the drawback is the memory required to store the large amount of triangles (and this is GPU unfriendly too).

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 10:19 am**

by **spectral**

Thanks Dade,

Yes I have see how you do in LuxRender, but it is not really of high quality if you zoom on the hairs... except if you tessalate a lot !

So, I'm looking at different approaches but also looking to directly compute the "curved mesh" ray intersection... by example, there is one paper "Ray tracing for curves primitives", but even this approach is not perfect !

But anyway all the approaches are interesting and it depends of the scene

BTW: Sure, the real challenge is to implement it efficiently on the GPU !!

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 11:05 am**

by **lion**

What if combine both approaches?

- Build BVH of tessalated hair.
- Use triangles at big distance.
- At small distance compute "curved mesh" ray intersection only if ray hits BVH leaf.
- Possibly split "curved mesh" to smaller and simpler curves for each BVH leaf\group of leafs.

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 11:22 am**

by **spectral**

Sure,

It is a way to setup the scene... even automatically. But, I'm not playing with LOD, simplification, etc... for now !

Just looking for some "ray - curve" intersection method

(Even for ribbons, faced planes, smooth cylinders etc...)

Thanks

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 1:56 pm**

by **lion**

### Re: Hair intersection : approaches ?

Posted: **Thu Feb 13, 2014 2:05 pm**

by **spectral**

Thanks...

Also, looking for the following paper : "Real-Time Hair Modeling and Rendering using Ray Tracing on GPU: Introducing "Continual Cylinders" to represent hair"

If someone has a copy, he is welcome

Thanks