Jump to content
  • Advertisement

Bluntest

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

127 Neutral

About Bluntest

  • Rank
    Newbie

Personal Information

  • Interests
    Design
    Programming
  1. Bluntest

    Octree vertices lag

    Thanks for the replies everyone. I ended up just making my own octree library. Speed issue is resolved.
  2. Bluntest

    Octree vertices lag

    This is like the "initializing" of my terrain, it all only happens once and it happens in less than a second. The world_scale never changes. Its just to scale the world so the positions aren't between 0,1 ( way too small ). I actually haven't look at how much memory it's using but I'm not sure thats the issue considering removing the octree.update in my render loop stops the lag. I will definitely keep the memory in mind though. I don't want that to be a later issue. Thanks
  3. Hey guys, I've added every vertex of my terrain mesh into an octree so I can quickly pick which vertices are around me while moving. Issue is it's insanely laggy and I'm not sure why. There are tons of octree examples where it improves performance. My project is in Three.js, I'm using threeoctree library provided by the developer. BufferGeometry doesn't have an array of vertices so I build it from the positions. var vertices = Array(); for(var i = 0; i < 100309; i++) { var vertex = new THREE.Vector3(); vertex.x = node.geometry.getAttribute("position").array[(i*3)]*that.world_scale; vertex.y = node.geometry.getAttribute("position").array[(i*3)+1]*that.world_scale; vertex.z = node.geometry.getAttribute("position").array[(i*3)+2]*that.world_scale; vertices.push(vertex); } console.log(vertices); node.geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3,true) ); node.geometry.vertices = vertices; that.octree.add(node,{useVertices:true}); I feel like 100k vertices in an octree shouldn't be causing that much of an issue, after adding the vertices into the octree and updating the octree in the loop Im hovering at about 20fps. I have an i7-8700k and GTX1080. I don't think this should be lagging. Should I be using an octree library that ignores the mesh/rendering completely? Thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!