Jump to content

LOD mesh disappears when partially out of screen


mojojojo
 Share

Recommended Posts

Hi guys!
I'm new with Babylon and I'd really appreciate some advise.

I am trying to create a tiled ground with LOD meshes.
For some reason the tiles on the edges of the viewport get filtered out and not rendered, despite being close enough.
Any idea whats causing it and how to prevent it? 

Screenshot at 2016-04-25 11:58:07.png

Link to comment
Share on other sites

Hi vtodo, welcome to the forum!  I don't have any solution, but I found this LOD playground scene... http://www.babylonjs-playground.com/#FZLQQ

Mousewheel-in/out, see the LOD's change on the single ground mesh.  I'm not sure if this is the same type of LOD that you are experimenting-with.  Maybe.

Perhaps you could try to reproduce the issue... using that playground (do edits, hit RUN and SAVE as often as you wish, have some fun).  I know that the hottest issue-troubleshooters 'round here... really like it when the problem can be reproduced in a playground scene.  Lots of eyes, easy to run tests, etc.

Anyway, welcome again, sorry about the troubles... we'll fig it.  :)

Link to comment
Share on other sites

55 minutes ago, Wingnut said:

Anyway, welcome again, sorry about the troubles... we'll fig it.  :)

Hey , thanks !


Here is the playground demo :
http://www.babylonjs-playground.com/#1I83IB#2

When you rotate the camera, pay attention to the spheres in the corners. They disappear without any of the substitutes showing - as if they get filtered out.

 

Cheers

 

Link to comment
Share on other sites

Well.. My intention was to use empty meshes as containers for the LOD mesh. None of the containers should have the level 0, except the last one...
I want each LOD mesh to be visible only in a fixed range.

What I care really about are those LOD meshes on the border of the viewport. In the attached screenshot - the purple-black highlighted tile is further away from the camera than the one in red. And the red is not rendered. Its really noticeable in the playground - when you zoom a bit and have the objects at the edge of the viewport. Then a slight rotation of the camera makes them appear and disappear - same as the jarred edges of the attached screenshot.

 

Cheers

Screenshot at 2016-04-25 11:58:07.png

Link to comment
Share on other sites

Yep but if you are doing this:

            t.addLODLevel(zoom_distances[zoom_level], lod);
            t.addLODLevel(zoom_distances[zoom_level-1], null)

 

with zoom_level = 1; zoom_level < zoom_distances.length; ++zoom_level

you are overwritting all previous level with null. Which seems really weird to me!

Link to comment
Share on other sites

Well, I'm not using the LOD system in the usual manner ;) I want each of the meshes to be visible only within a fixed distance range. Sure there is a better way than using the LOD - right now I'm kind of abusing it...
But hey -
turns out that disabling the frustum fixes my problem!
http://www.babylonjs-playground.com/#1I83IB#6
Now I don't want to completely disable the culling... Tried adjusting camera minZ and maxZ, but it doesn't seem to affect this issue.
Is there a way to extend the frustum planes?

 

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...