Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2021-10-20 17:00:46



Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next
Mesh viewing quirks - Do I have a setting wrong? 
Author Message

Joined: 2009-03-17 18:42:51
Posts: 4751
Reply with quote
So... I investigated this issue today, and it is not a viewer bug, but an issue with badly designed meshes that happen to show fine once "optimized" (decimated) by LL's mesh vertex cache (buggy !) algorithm...

Let me elaborate:

LL's algorithm for optimizing vertex cache happens to work under Windows, but fails under Linux (and most probably macOS as well). Like Nicky Dasmijn explains in Firestorm's sources:
Code:
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060/FIRE-29492
// cacheOptimize will destroy triangles. This is due to LLVCacheVertexData pointing to vertices in the vector vertex_data.
// Once vertex_data is sorted (std::sort(triangle_data.begin(), triangle_data.end()) ) this will invalidate those pointers and
// LLVCacheVertexData suddenly does point to unrelated vertices. It is an interesting fact that this is no problem for the
// windows version.

As a result, the optimization code is disabled for Linux in Firestorm... And you get this:
Attachment:
FS.jpg
FS.jpg [ 102.76 KiB | Viewed 194 times ]
I.e. exactly the same result as with the current Cool VL Viewer version, because I disabled the vertex simplification pass with the "meshoptimizer" library (due to bad results with other meshes) that replaces LL's buggy code.

Fact is that this particular hair item is simply badly designed (since it should display properly without any optimization pass, and it does not), and its creator likely only tested it with LL's viewer under Windows (where the hair shows fine).

In older releases of the Cool VL Viewer, where the "meshoptimizer" library was not used, I had a (partial) fix implemented for the bogus sorting in LL's algorithm, and it appears that it did a better job than "meshoptimizer" (even if still not perfect under Linux). I will therefore reimplement LL's old algorithm with that fix, and you will get this with v1.28.2.20:

Linux:
Attachment:
CLVL18220-linux.jpg
CLVL18220-linux.jpg [ 91.27 KiB | Viewed 194 times ]


Windows:
Attachment:
CVLV128220-windows.jpg
CVLV128220-windows.jpg [ 83.17 KiB | Viewed 194 times ]


As for the "Leo" hair, it displays fine under both Linux and Windows with that partially fixed algorithm...

This said, when you encounter such problematic meshes, you should report them to their creator; the latter should really test properly their meshes and make sure there is no degenerate vertices and other glitches that might end up showing up depending on the viewer they are rendered with, or even to the settings in use (LOD level, etc)...


2021-04-15 14:46:06
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 324
Reply with quote
Great, thank you Henri

We'll write the creators and let them know. :)


2021-04-17 08:53:26
Profile

Joined: 2011-09-17 11:12:19
Posts: 324
Reply with quote
I still see the issue here for mac os in 1.28.2.20. Is there some setting to change or a build setting perhaps?

Edit: Since this happens, from what I can see, only with new hairs from several different creators, I wonder if there is some bug in the authoring tools, like for instance avastar or the new blender, or in the newer importer. Seems a bit strange that no older hairs we have tried display this issue, even from the same creators. Only the newest ones we try. Have tested 6 different hairs now from 4 different creators and haven't found one that doesn't have the issue to some degree.


Attachments:
Screenshot 2021-04-17 at 14.36.41.jpg
Screenshot 2021-04-17 at 14.36.41.jpg [ 48.17 KiB | Viewed 156 times ]
2021-04-17 12:40:02
Profile

Joined: 2009-03-17 18:42:51
Posts: 4751
Reply with quote
There is, for now, no perfect solution for Linux and macOS for such bogus hair. The implementation of the mesh decimation algorithm by LL makes assumptions on idiosyncratic (i.e. non-conforming to C++ standards) features of the VS2017 STL containers implementation and, as a result, only "properly" works under Windows (and could possibly break with future Visual Studio versions)...

Again, it's a mesh design issue (since this optimization step should not need to be taken for the mesh to show right). The problem here is that most creators will use LL's Windows viewer to test their mesh and will not detect such issue as a result... They'd need to use a viewer that got an optimization switch (such as my viewer, in Advanced -> Rendering) and switch it off to verify their mesh renders fine.


2021-04-17 13:25:09
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 324
Reply with quote
Yea. I will try write some of them and see, but I have little hope the designers will remake their hairs cause it doesn't show correctly in cool viewer on mac / linux, even though we can both agree they should do their work correctly :)

I was a bit worried after our tests, where it looked like the majority of hair producers did poor meshes now, but I did some tests just now, where I googled who the most popular hair designers atm. I got demo hairs from the top 10, and only 3 of them had the issue, one of which was one of the creators we tried before, so I guess it isn't that big an issue. We'll just stay clear of those.


2021-04-17 14:14:11
Profile

Joined: 2009-03-17 18:42:51
Posts: 4751
Reply with quote
Catten wrote:
Yea. I will try write some of them and see, but I have little hope the designers will remake their hairs cause it doesn't show correctly in cool viewer on mac / linux, even though we can both agree they should do their work correctly :)
Just point them to the Linux version of Firestorm (where that mesh vertex cache optimization is disabled and will show their mesh "as is"): that might motivate them more...


2021-04-17 14:31:55
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 324
Reply with quote
Hehe perhaps that might yes. Out of curiosity, why isn't the firestorm mac viewer effected by this?


2021-04-17 16:26:25
Profile

Joined: 2009-03-17 18:42:51
Posts: 4751
Reply with quote
Catten wrote:
Hehe perhaps that might yes. Out of curiosity, why isn't the firestorm mac viewer effected by this?
Well, Firestorm got the optimization disabled only for Linux, but you should see glitches as well (albeit not quite the same) with their mac binary. If not (with the TRUTH hair, especially), then you could try to #define LL_BAD_VERTEX_SORTING to 1 at line 5553 of indra/llmath/llvolume.cpp and see what happens: the Cool VL Viewer will then use LL's sorting instead of the (partly) fixed one (which should give an exact equivalent of Firestorm's and LL's viewer code)...


2021-04-17 19:12:38
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 324
Reply with quote
Changing that to 1 doesn't seem to change anything for me. For precautions and did a fresh build to make sure there wern't any cashing or something.

Screenshots below are difference from Cool Viewer with the LL_BAD_VERTEX_SORTING to 1 and Firestorm for mac


Attachments:
coolfire2.jpg
coolfire2.jpg [ 41.55 KiB | Viewed 128 times ]
coolfire1.jpg
coolfire1.jpg [ 44.28 KiB | Viewed 128 times ]
2021-04-18 09:59:55
Profile

Joined: 2009-03-17 18:42:51
Posts: 4751
Reply with quote
Correct me if I'm wrong, but the first set seems pretty similar... So the change to the "bad sorting" algorithm seems to fix most of the rendering glitches !

However, there should not be any difference... But since I do not have any macOS machine available to test the viewer (only a VM that can be used to compile it, but not to run it, by lack of OpenGL drivers), I cannot diagnose this issue... You are alone on that one, I'm afraid !


2021-04-18 11:04:09
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page Previous  1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.