ands / seamoptimizer

A C/C++ single-file library that minimizes the hard transition errors of disjoint edges in lightmaps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

question about error function design

qiankanglai opened this issue · comments

In the pdf from TLFU, error function is designed just to mesure E_total=\sum{E_i}.

However when I'm testing special cases (cosNormalThreshold=-1), this wired case happened:
7088515f-a981-4d70-b7f1-2ca63d262e86

I'm wondering if adding outer pixels measurement into error function may help?

commented

Hey!

not sure I understand. What would you expect to see?
A cosNormalThreshold of -1 is very unusual as it would even interpolate the seams between a front and a backface that share the same edges. May I ask what are you trying to achieve?

Best,
ands

cosNormalThreshold=-1 is not a practical parameter setting but I'm just testing the hardest corner case.

Would you mind provide some details of mathmatics part in so_seam_optimize? eg. How is the sparse matrix built for optimization so I can try improving it myself. (I tried to figure it out but failed 😢 )

commented

Hey! Sorry I didn't reply for so long. I had lots of other stuff to do and totally forgot about it :(.
Unfortunately, the sparse matrix setup isn't that simple to explain and it changes depending on usage. I'd even need to look into it myself again before attempting an explanation. I should really write up some documentation for this!

Does closing the issue mean you figured it out yourself, or did you give up on this?

Best,
ands

I've figured it out already (In fact a very simple problem occured when converting uv to texcoord of lightmap)
Here is my port of your great work in Unity: https://github.com/qiankanglai/seamoptimizer (Just a side project in part time 😄 )
Readme will be done in one week if I have enough free time.

Thanks!