aWeirdo Posted October 28, 2016 Share Posted October 28, 2016 Hey all, I was wondering if anyone knows any good ways of simulating a far away horizon? With a completely flat ground mesh with 2 subdivisions, it isn't really a problem, since you can just scale it to 1000 x & z without much performance impact. But when you need to add smooth height differences in the ground mesh to simulate a real area of ground, you'll need a massive increase in indices in the ground mesh, Protentially creating a huge performance impact on low-end devices. Example; //1000 x 1000 ground, un-comment "subdivisions = scale;" at top of code section, and it jumps from 24 indices, to 6million, and even at that point, any height differences applied will not be super smooth.http://www.babylonjs-playground.com/#1BXWQM#0 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 28, 2016 Share Posted October 28, 2016 I have a scene in dev where the camera moves a lot. I found using 2 meshes worked well. First mesh is the mountains. It is irregular shaped. The 2nd is a circle plane (built in blender, 32 verts). You will never see "the corner" on a circle, so it does not need to be that big, vertex wise. I make the mountains mesh go through the circle plane very slightly, but in your case I would put the smaller terrain-ed mesh just slightly above the circle plane. Hopefully, you will not be able to tell. aWeirdo 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted October 28, 2016 Share Posted October 28, 2016 If you use a skybox you must "paint" the distance blur directly on it, and use fog to "merge" the color ! Otherwise the lensRenderingPipeline can add depth of field but is really power demanding ... I'm investigating into making a nice "horizon" too right now :-) Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 28, 2016 Author Share Posted October 28, 2016 Appreciate the responses guys @JCPalmer Very interesting approach, i'll definitely look into that. @meteoritool I'm not using any fog for this specific scene, the plan atm, is to add far away mountains and stuff on a skybox, But i need the actual ground mesh to look and feel like it's going on forever, (Simular to the middle part of this picture) Quote Link to comment Share on other sites More sharing options...
jerome Posted October 28, 2016 Share Posted October 28, 2016 you can build your plane directly in BJS (just set the tesselation parameter to 32 if you want only 32 vertices) : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#disc you could also build some immutable SPS to depict the mountains (or anything else in the distance) with just few vertices : http://doc.babylonjs.com/overviews/Solid_Particle_System#create-an-immutable-sps or unless what you have in the distance stays in the distance far away, maybe you don't really 3D for this and some sprites or textured billboarded planes could do the job 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.