hair and fur

Use this forum for general user support and related questions.
User avatar
B.Y.O.B.
Developer
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Mon Sep 10, 2018 5:57 pm

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.
Support LuxCoreRender project with salts and bounties

lacilaci
Posts: 150
Joined: Fri May 04, 2018 5:16 am

Re: hair and fur

Post by lacilaci » Tue Sep 11, 2018 3:10 pm

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
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Tue Sep 11, 2018 4:49 pm

I think I can finish it in the next days.
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Wed Sep 12, 2018 10:04 am

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)
Support LuxCoreRender project with salts and bounties

User avatar
Sharlybg
Supporting Users
Posts: 689
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: hair and fur

Post by Sharlybg » Wed Sep 12, 2018 10:34 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.
(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

User avatar
B.Y.O.B.
Developer
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Wed Sep 12, 2018 2:38 pm

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.
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Sun Sep 16, 2018 3:38 pm

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
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 1476
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: hair and fur

Post by B.Y.O.B. » Sun Sep 16, 2018 8:15 pm

Emitter vertex colors -> hair vertex colors support is done:
Attachments
2018-09-16_22-14-18.png
Support LuxCoreRender project with salts and bounties

lacilaci
Posts: 150
Joined: Fri May 04, 2018 5:16 am

Re: hair and fur

Post by lacilaci » Sun Sep 16, 2018 8:39 pm

so i guess alpha v4?

User avatar
Sharlybg
Supporting Users
Posts: 689
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: hair and fur

Post by Sharlybg » Mon Sep 17, 2018 9:32 am

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

Post Reply