Jump to content

Search the Community

Showing results for tags 'octree'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 7 results

  1. Hi Folks, I wrote a small selection effect like in the playground http://www.babylonjs-playground.com/#2EHGYF#7. Actually I add cloned meshes on top of the originals. This seems to work perfectly but every time I select, unselect a mesh, I need to update the Octree. I am working on a similar effect on highlighting when the hover the mouse on the meshes. I am not sure if the performance can be OK with large models. Is there any way to handle this? I mean maybe I can have another scene or...the Octree can be applied only on the main scene? Many thanks
  2. 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!
  3. Hi, I wonder what is the best way to get only these meshes which are visible by camera at the moment. I know there is octree implementation in babylon, but Im not sure how to use it. I've seen this https://github.com/BabylonJS/Babylon.js/wiki/Optimizing-performances-with-octrees but still have problems to make it work. If someone could explain (write a piece of code or pseudo code) how to make it. Lets say I have 5 cubes on my scene and a free camera. I would like to have a function that would return meshes which are visible in a viewport of my camera. Thank you, Regards V.
  4. Hello, i need a playground sample on how to use octrees?
  5. Hi! I'm trying to create unit (mesh) selection as it is in various strategy games(AoE, CnC (attached image) ...). After some exploring, I've came to the following, but there are a couple of steps I don't know how to do: 1. Hook to events (OK - trivial) 2. Draw lines using BABYLON.Mesh.CreateLines - at what position? Set LineMesh parent to camera? How to translate mouse position (scene.pointerX and Y) to world coordinates? Just draw rectangle and and set transformation matrix to identity (4x4)? Canvas 2d and 3d context can't be used together. 3. Once that is known, visible meshes are selected with octree (frustum plane is created and used for selection via octree.select method). But frustum plane can be very small and very close, or very big and far away (but this it's probably solved at step 2) I haven't really got to point 3. (got stuck at 2) so it's only my speculation. I'm open to suggestions if there are any better options . Explanation for attached image for non strategy game players: Green rectangle was drawn simply clicking in one corner and dragging. It's always orthogonal to camera view and at the same position (also based on camera) even if camera is moved or rotated. Its rendered above everything and every unit inside is selected. Thanks!
  6. Long list... trying to fully wrap my head around all this stuff... If I'm wrong on anything feel free to correct me. You won't hurt my feelings. I'm just trying to learn as I go. Octree: scene.createOrUpdateSelectionOctree(); If I put this in my load script anywhere, all the models disappear. It's basically just a black scene. When should this be called in the script, and can anyone give me a very basic overview of how and where to work with the octrees... scene.executeWhenReady?, engine.runRenderLoop?... How do you work with them in real time. FBX / Bones / Animations: If I use the online FBX converter, it doesn't seem to have my bones or animations. Do bones need to be separate files from the meshes and then joined within Babylon? Either my FBX is being exported wrong from 3DS Max 2013, or the converter isn't exporting it correctly, bones cannot be combined into one object, or I'm not setting it up right. BABYLON.SceneLoader.ImportMesh("", "../Models/Monsters/", "BGoblin_1.babylon", scene,function (mapZone, particleSystems){ mapZone[0].scaling = new BABYLON.Vector3(0.005, 0.005, 0.005); mapZone[0].rotation = new BABYLON.Vector3(0, -3.141593, 0.000000); mapZone[0].position = new BABYLON.Vector3(-106.345, 4.32, -13.905); scene.beginAnimation(mapZone[0], 0, 296, true);});Zip file attached with FBX, and *.babylon file. Converted here: http://www.babylonjs.com/converter.html Another weird thing... if I open my FXB in 3DS Max after I save it, only 100 of my 296 or so key frames seem to still be on the model... any ideas on this one? Packages: What's going to be the best way to handle multiple packages. For example, my game is going to have 20~30 maps, and stitch a few of them together by view range and user's machine capabilities. The main town alone has like 600,000 vertices not counting NPCs, collision meshes, etc. So ideally I don't want to have to pack 30 maps worth of objects into a single blender / 3DS Max file. What's going to be the best way to handle this huge number of files. I've tried loading a few things with BABYLON.SceneLoader.ImportMesh but once it's loaded, I have no clue how to access the loaded meshes any longer. objName = scene.getMeshByName("Rag2_bro_mtree_a_04"); throws a null object. There will be way too many items to be able to work with them all in a single 3D editor package. This also brings me into LOD situations where I will for sure need to switch out lower resolution models. This isn't possible if there's no way to call back into the list of loaded models and set visibility etc. Maybe there's something I'm missing, or don't know about... If there was a way to chain the loading of multiple *.babylon packages through a single BABYLON.SceneLoader.Load() call, then I assume that you would be able to manipulate them dynamically in the render loop. Maybe have some kind of function that you can push multiple *.babylon files into a single temp file to load? Then you can load as much stuff as you want up at once.. var fullScene = addPackage(fullScene, "package1.babylon");var fullScene = addPackage(fullScene, "package2.babylon");var fullScene = addPackage(fullScene, "package3.babylon");function addPackage(loaded_packages, package_to_add){ if loaded_packages is a valid babylon file format, then add the package_to_add to the end of loaded_packages return loaded_packages;}BGoblin_1.zip
  7. This is my first post, so I say hello to all of the community!) I'm trying to make a game graphically similiar to Transport Tycoon, Simcity 3000, RollerCoaster Tycoon, but with mixed sprites+ simple 3d objects. Here's what I had a year ago. http://narushevich.lv/isometrica Basically any of the available 3D engines would fit perfectly, BUT, as I found out it's hard to reproduce that feel of oldschool sprite graphics with sharp pixels etc. in 3D engine, and using engines such as three.js would be like running VW Beetle on jet engine. That's why I decided to teach myself and write a simple 2.5D game engine, currently only with sprite rendering. And it's already a while as I try to make an efficient octree, with realisation that wouldn't be tied to some game engine, and would be as reusable module. What I have found on the web is: - ThreeOctree - which is kinda efficent realisation of octree for three.js, but it's strictly tied to three.js. - Few non-serious demo realisations - which was slow. What I need: - octree with grow/shrink functionality - point & AABB support - fast insert/remove I have tried to do it myself, you can explores sources here: https://bitbucket.org/narushevich/octree/src But it takes ~30ms, to build tree of 10k AABBs on my i5 quad-core. That's slow. I'm not going to rebuild whole tree on each frame, I rather update items that have changed their position/orientation. Insert/remove is slow. Also it takes to much time to retrieve items. Mostly becauses of usage of indexOf's to remove item duplicates in resulting item array. I had some test using typed arrays for Node and Item data structures, pooling then on startup. But that was even slower. I created this topic in hope that someone could point me to already done super-fast octree/quadtree realisation! It would be good if someone would also tell me the most efficient octree or quadtree writen in ActionScript or even C++, I would then try to port them to javascript.
  • Create New...