Code Monkey home page Code Monkey logo

Comments (9)

mrdoob avatar mrdoob commented on May 5, 2024

Yeah, I think alteredq was going to take a look at improving the instancing.

GeometryUtils::merge does the consolidation thing already.

from three.js.

525c1e21-bd67-4735-ac99-b4b0e5262290 avatar 525c1e21-bd67-4735-ac99-b4b0e5262290 commented on May 5, 2024

Oh wicked. This makes what I was trying to do super-easy.

I don't want to step on alteredq's toes and don't even need instancing ATM so I'll leave that for now.

from three.js.

alteredq avatar alteredq commented on May 5, 2024

Yeah, I have VBO reuse on my TODO list.

from three.js.

525c1e21-bd67-4735-ac99-b4b0e5262290 avatar 525c1e21-bd67-4735-ac99-b4b0e5262290 commented on May 5, 2024

fabricasapiens (via email) wanted to know why "the engine gets pretty choppy when I output 900 objects" and how to fix it...

GeometryUtils::merge will join the cubes into a single mesh (and therefor single VBO for giving to WebGL) which will reduce you draw calls from hundreds down to one (which is the reason for your low FPS).

Of course you lose some flexibility here (it's slower and more difficult to animate/manipulate individual cubes) but it's a necessary evil when facilitating "infinite" chunk-based worlds.

from three.js.

mrdoob avatar mrdoob commented on May 5, 2024

I'm getting confused. Where did fabricasapiens asked that? I don't see him in this conversation... ?

from three.js.

525c1e21-bd67-4735-ac99-b4b0e5262290 avatar 525c1e21-bd67-4735-ac99-b4b0e5262290 commented on May 5, 2024

It was via email. I thought I'd post it here since it's relevant.

Using GeometryUtils::merge his FPS rose from <10 to the full 60.

~40FPS with 4000+ cubes.
~30FPS with 16000+ cubes.
~15FPS with 65000+ cubes.

alteredq - I'm not expert at the materials in three.js but do these cubes have two materials applied? One for the green and one for the lines? If so...does that mean they require two passes or draws?

http://d.pr/GrLX

At reasonably low numbers of cubes (<10000) it's the fillrate not the drawrate that's slowing down fabricasapiens's app.

from three.js.

 avatar commented on May 5, 2024

So here is 'Fabricasapiens' himself ;-)

( Sorry if I'm asking noobish questions. I don't have experience with 3D engines, and try as best as I can to understand what is going on... )

What is the difference between drawrate and fillrate?
And why (technically) is one large object faster to render than a bunch individual objects? I understand that reading more objects takes more time, but the large object still has all the same vertices present, so what differnce is there in rendering...?

from three.js.

mrdoob avatar mrdoob commented on May 5, 2024

https://github.com/mrdoob/three.js/wiki/%22infinite%22-chunk-based-worlds

from three.js.

525c1e21-bd67-4735-ac99-b4b0e5262290 avatar 525c1e21-bd67-4735-ac99-b4b0e5262290 commented on May 5, 2024

On TODO list. Closing...

from three.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.