hair and fur

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

I had to fight some very annoying self-inflicted bugs, but now the basic hair conversion works in all my testscenes, even with some pretty pathological cases (e.g. all hairs with length zero).

Bonus: weird stuff happens if you set worldscale to 0.001 because my epsilon was a bit too big in this case - but at least all point arrays still have the correct length :D
I now made the epsilon smaller so even this crazy worldscale works now.
2018-09-10_19-51-36.png
Todo: color export.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: hair and fur

Post by lacilaci »

So would you say, we can expect some improvements in the next alpha? :) or is this some ongoing work that will take some more time?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

I think I can finish it in the next days.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

What is really annoying is that I currently have to call a Blender function through Python for each hair strand.

For example, the conversion of a hair system with 200,000 individual hairs has these timings:
- Calling Blender's co_hair function 200,000 times to fill a numpy array with coordinates: 5.342 s
- Checking the points for invalid ones, calculating the number of valid segments etc. (this code was pure Python before and is now C++): 0.083 s
- Tessellating the hair with "triangle ribbon" mode: 1.05 s

I will have to check again if I can somehow do the first step in C++ as well, but last time I looked it wasn't feasible.

(by the way the same hair system takes 20.951 s to export with the old code)
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: hair and fur

Post by Sharlybg »

I will have to check again if I can somehow do the first step in C++ as well, but last time I looked it wasn't feasible.
(by the way the same hair system takes 20.951 s to export with the old code)
That is a huge improvement anyway ;)
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

B.Y.O.B. wrote: Wed Sep 12, 2018 10:04 am I will have to check again if I can somehow do the first step in C++ as well, but last time I looked it wasn't feasible.
As I thought, I found no way to speed this step up.
I even tried calling the co_hair function from C++ (though boost::python), but that was even slower.

So, I'll write the color export and then it should be done.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

Had to cope with non-existent documentation again.
But now the mode "UV image -> vertex colors" works again for hair.
I think I will add a new mode that only copies UV information to the hairs, without creating vertex colors, and try to make the UI less confusing.
Attachments
2018-09-16_17-36-15.png
hair_with_colors.jpg
2018-09-16_17-41-48.png
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. »

Emitter vertex colors -> hair vertex colors support is done:
Attachments
2018-09-16_22-14-18.png
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: hair and fur

Post by lacilaci »

so i guess alpha v4?
User avatar
Sharlybg
Donor
Donor
Posts: 3101
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: hair and fur

Post by Sharlybg »

Awesome results ! you're inspiring :idea:
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA
Post Reply