Page 3 of 5

Re: hair and fur

Posted: Mon Sep 10, 2018 5:57 pm
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.

Re: hair and fur

Posted: Tue Sep 11, 2018 3:10 pm
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?

Re: hair and fur

Posted: Tue Sep 11, 2018 4:49 pm
by B.Y.O.B.
I think I can finish it in the next days.

Re: hair and fur

Posted: Wed Sep 12, 2018 10:04 am
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)

Re: hair and fur

Posted: Wed Sep 12, 2018 10:34 am
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 ;)

Re: hair and fur

Posted: Wed Sep 12, 2018 2:38 pm
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.

Re: hair and fur

Posted: Sun Sep 16, 2018 3:38 pm
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.

Re: hair and fur

Posted: Sun Sep 16, 2018 8:15 pm
by B.Y.O.B.
Emitter vertex colors -> hair vertex colors support is done:

Re: hair and fur

Posted: Sun Sep 16, 2018 8:39 pm
by lacilaci
so i guess alpha v4?

Re: hair and fur

Posted: Mon Sep 17, 2018 9:32 am
by Sharlybg
Awesome results ! you're inspiring :idea: