Giter VIP home page Giter VIP logo

Comments (2)

john-chapman avatar john-chapman commented on June 16, 2024 1

I've not really looked into this since the issue was created, but I think it would be quite simple to implement an initial version. Updated thoughts:

The main goal here would be to provide an API allowing the user to avoid the overhead of making lots of Im3d calls. User code would look like this:

if (Im3d::BeginCache("BigScene")) // If false, we skip Im3d calls below and use the cached vertex data directly.
{
    // ... lots of Im3d calls here.

    Im3d::EndCache(); // Cache the vertex data we just created.
}

Internally, cached vertex data would follow the structure of m_vertexData (= one list per layer, per primitive * 2 for sorted/unsorted). This way, the cache can be copied into m_vertexData such that sorting/layering still works. There would also be an InvalidateCache(id) function.

The approach outlined above has a couple of caveats:

Transform modification:

  • Could store the top of the transform stack per cache, if it's different when we go to copy the cached data we can re-transform the data there.
  • That would only support a single global transform modification per cache. Anything more complicated requires invalidating the cached data.

Nested caches:

  • Nested caches won't invalidate properly, as the nested cache data will effectively be duplicated in the enclosing cache.
  • Could potentially solve by storing a list of nested caches per cache. Invalidating a cache would also invalidate any referents.

from im3d.

ChemistAion avatar ChemistAion commented on June 16, 2024

I was wondering if there have been any updates or progress made since?

from im3d.

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.