Jump to content

Triangles oddly lit


SvenFrankson
 Share

Recommended Posts

Hi everyone,

Help please ? I've spent quite a time stuck on a rendering issue and might need some inputs...

I'm facing some issue when trying to render scenes in some cases.

The issue looks like this :

test_bug.thumb.png.2de9b74ad1eb39d1ef5ee364b6adf980.png

(the mesh is supposed to be smooth, triangles should not be seen)

Any hint on what could cause this behaviour ?

Here's what I've already found.

- Here's the minimal scene I have with this problem : http://svenfrankson.github.io/test.babylon

(how do I link it to the playground ?)

- There's a ReflectionProbe and a ShadowGenerator in the scene, several Lights too.

- If I set receiveShadows = false on the mesh, problem is solved. (but I'd like to keep receiveShadows = true)

- Switching between PBRMaterial and StandardMaterial does not seem to change anything.

I'd say at some point the geometry get broken, but I don't even understand how it would cause it to display like this (normals inverted on one axis ? or out of some range ?)

If you have any idea, please enlighten me !

Thanks for your help ! Have a nice day !

Link to comment
Share on other sites

Hi, thanks for the input Sebavan :)

It took me a while, because I don't know how to include a fully serialized scene in a Playground (the scene I linked with my question), and did not knew what was causing the problem so I could not isolate it in a playground...

But, by eventually stripping the scene file of all it's components, I'm pretty sure I found it.

Something (in my case, a "pop" animation at mesh instantiation) made the mesh scaling somehow different of (1, 1, 1) - yet, close to-, which causes the odd rendering.

Here's a repro : http://playground.babylonjs.com/#SF5KIL

My guess is it's a bug, maybe when normals are recomputed upon scaling ?

Link to comment
Share on other sites

Hi SF!  I did some goofing around...

https://www.babylonjs-playground.com/#10MM3T#6

Lots of bad links to textures, so far... but.... there it is... in the playground,  sucked-in from your SvenFrankson.github.io folder.  FUN!

I'm not real experienced at loading things, so I hacked cameras and lights a bit.  I used a goofy scaleTo function... to ani-scale each of the 10 imported mesh nodes... 12 times larger.

I don't see any tessellating problems, so far. 

Your issue is very interesting... curious.  Needs investigatin'.  :)  (Wingnut slips-on his Sherlock Holmes costume, and lights his pipe, with a facial expression of deep contemplation)  :)

Link to comment
Share on other sites

Thanks a lot Wingnut, I had never used AppendScene, seems like it did the trick ! You're the best

Textures are broken in this sample but it's not a problem, I create this scene by stripping parts of a larger one, hence the missing textures. The missing textures are about materials shown in the original scene but not linked to this cup, so they may as well go to 404 error :P

On your playground, I have the same issue as when I open the scene in a Sandbox (see first picture I linked where triangles appears oddly) : it's perfectly failing and displaying the bug ^^ Well done !

@Sebavan

I'm using a MacBook Pro mid-2015, OS X El Capitan 10.11.6, running Google Chrome Version 65.0.3325.181

I checked on Mozilla Firefox, the mesh is displayed well, on both Wingnut's playground and my repro.

On the playground I linked, I see this

bug.png.d299576b406faf0f9e2d20c3b0102a6e.png

While not exactly similar (I see no triangles here), this odd display is also caused by the scaling value, so I guess the causes are the same.

Again, thank you both !

Link to comment
Share on other sites

Thanks for the report (and for the nice words), SF.  The PG was made by someone else... Nutiler, I believe.  I just tweaked it a bit.  Somewhere on the forum... is info about the differences between Append vs. Load, but I can't remember what they are. 

I suppose someone should try to upgrade it to AssetsManager... and then you'd have a sweet PG model loader tool.  This is the first time I ever tried loading from a github.io URL.  Good to see that it is possible.  Your .babylon file might be the first ever, loaded-into PG from a URL like that.

I don't see that rendering problem in any of these PG's ... using my non-Edge IE or my FF 52 ESR.    No triangles issue, no "pumpkin ridges" issue, like seen above.  hmm.

I don't have Google Chrome, but I suppose I could install it, for testing purposes.

Let's see what Sebavan discovers with his tests, and listen for more comments.  I think I am going to do some web searches... see if I can discover anyone else having this same problem with webGL renders.  I'll report findings if some are found.

Scaling-related.  hmm.  *scratch scratch*.  Sven, if you revert to older versions of BJS, any changes?  (thx)

Link to comment
Share on other sites

Do you mind opening a bug at Chrome bug database.

As a workaround I can offer this: I can add a Math.IgnoreNonUniformScaling Boolean that could turn off the feature (or you can make sure your scaling is always uniform)

 

Link to comment
Share on other sites

This works fine for us with MacOS High Sierra 10.13.4 and Chrome Version 66.0.3359.139 (Official Build) (64-bit) We ll continue to look into the issue but you might try to update your drivers.

image.png

Link to comment
Share on other sites

Thanks @Deltakosh

I'm running OS X El Capitan Version 10.11.6, updated a few seconds ago, still having issues with the sphere.

As far as I'm concerned, no need for a fix with a boolean, odd scaling where mostly due to rounding errors on matrix decomposing, making sure scaling is uniform is easily done. 

I'll check with Chrome bug database as well

Edit : Here it is in Chrome bug database : https://bugs.chromium.org/p/chromium/issues/detail?id=846715

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...