Search the Community
Showing results for tags 'maxz'.
Found 4 results
Hi guys I've just set up a regular ol'skybox for my scene exported from blender. The scene has a scale of 10 along the X and Y and 5 along the Z in blender. The skybox code is as follows; var skybox = BABYLON.Mesh.CreateBox("skyBox", 100.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.disableLighting = true; skybox.material = skyboxMaterial; skybox.renderingGroupId = 0; So far, so ordinary. The problem is when babylon renders the scene. With a particular zoom of the camera (camera is also exported from blender btw) it appears like the attached. Normally there's no issue using the skybox code shown above, this is the first time i'm seeing something weird. i thought maybe the 100.0 value in the createBox constructor was too small and so the camera was clipping part of the cube, but increasing it above 100 just makes the black area larger until it envelopes all. Reducing that number makes the cube smaller to the point where it's visible as a cube in the scene, which obviously isn't ideal. Am I missing something obvious here? Cheers!
I need to create very large scene (there are meshes with size 10, but also with 10^6). It requires set: camera.maxZ = Math.pow(10, 10) But then is not working pickedMesh (pickedMesh is always null): scene.pick(scene.pointerX, scene.pointerY).pickedMesh Is there any way to use very large camera visibility with functional pickedMesh? Here is demo.
Hi peeps, I've already published a similar topic not a while ago, but we couldn't really reach any conclusion: http://www.html5gamedevs.com/topic/32079-sprite-occlusion-for-performance/ I have this demo: http://devel.arinnova.com/tests/3dmaps/babylon_demo/ I'm trying to get a similar forest to this three.js scene: https://www.piste.io/#!/cortina . Notice how the forest is really dense and the FPS are really good. What I've already tried without success: 1) Loading meshes instead of sprites and applying LOD mechanism resulted in very low FPS. 2) Using mesh instances instead of sprites, still very low FPS 2) Temechon kindly helped me and coded a LOD function for sprites, but unfortunately it was more or less the same FPS as without the LOD. 4) Showing all the 54k trees, but using a particle system instead of sprites, which helped to reduce the draw calls, but the FPS were still low. 5) I've implemented a "poor man's LOD". I separated the 54k trees into 9 chunks, each chunk corresponding to a specific area. Then at every frame I calculated the distance from the camera to the central point of each area. If it was close enough to the camera, I showed the area trees and if not, I removed them. This way at each frame I had to calculate distances to only 9 points instead of 54k points, which helped but visually it was not pretty at all. Even applying a brown texture on the terrain underneath the trees, the chunks of trees appearing and disappearing all at once are very noticeable. 6) I also reduced the tree image size to 128x128, just in case, but I'm not sure it had an effect on FPS. Using an image of a pine tree or a leafy tree would create much more perception of a dense forest, but unfortunately I can't use those. The scene is a winter map of a specific real-world area with leafless trees and I'm trying to be as realistic as possible. A silly idea I've also tried was using an image of a group of trees instead of an image of a single tree. It obviously looked fake, especially when rotating the camera. Some other ideas that I've had but have not tried: Solid Particle System -> as it has more effect on performance than a simple particle system and I've already tried that. Octrees -> could this help me? I've read the tutorial but I'm not sure I understand how could I apply it to sprites. I don't know how camera.maxZ works internally, but is there possibly any way to apply it only to sprites, so the nearest sprites only are visible? Could I implement my own camera that does this? tldr; I'd like to show ~200.000 trees in my scene with minimal performance drawback. Thanks a lot in advance!
Hello folks! I wonder why the "zoomOn" method overwrites the maxZ attribute in the arcrotatecamera. Is there anywhay to pretend it from doing that? If I zoom on the meshes and the user zooms out afterwards, the mesh will become invisible. Therefore I always have remember the old maxZ, call the function and then reasign the old maxZ again. Any advice? Other question: What would be the best place for putting the "using babylon" informations? Somewhere behind an info button? Or in the corner of the 3D view? Like a "powered by BabylonJS"? I know that's the one thing to do when using Apache 2.0 for anything. Babylon is used to show 3D files or for 3D powered online configurators. We don't want to get into any troubles about that. Some advices are recommend. Thanks! Kevin