mojojojo Posted April 25, 2016 Share Posted April 25, 2016 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? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 25, 2016 Share Posted April 25, 2016 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. Quote Link to comment Share on other sites More sharing options...
mojojojo Posted April 25, 2016 Author Share Posted April 25, 2016 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 25, 2016 Share Posted April 25, 2016 Sounds like you added a level 0 with null inside (so no rendering at this level): http://www.babylonjs-playground.com/#1I83IB#4 Quote Link to comment Share on other sites More sharing options...
mojojojo Posted April 25, 2016 Author Share Posted April 25, 2016 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 26, 2016 Share Posted April 26, 2016 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! Quote Link to comment Share on other sites More sharing options...
mojojojo Posted April 27, 2016 Author Share Posted April 27, 2016 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 27, 2016 Share Posted April 27, 2016 Smart You have several options to play with the frustum: - increase the camera.fov - replace BABYLON.Mesh.prototype.isInFrustum by your own function - mark a mesh as alwaysSelectAsActiveMesh = true Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.