Giter VIP home page Giter VIP logo

Comments (6)

c-zhuo avatar c-zhuo commented on September 25, 2024

嗯应该是updateWebglStyle时没有释放缓存,晚上到家看一下

from easycanvas.

c-zhuo avatar c-zhuo commented on September 25, 2024

这两天发个版本修复;可以暂时在updateWebglStyle上面包装一个新的API使用,验证一下是否解决
例如

Easycanvas.sprite.prototype.updateWebglStyle_fix = function (key, value) {
    if (this.webgl && this.webgl[key]) {
        this.$canvas.$gl.deleteBuffer(this.webgl[key].$cacheBuffer);
    }

    this.updateWebglStyle(key, value);
}

from easycanvas.

cyitianyou avatar cyitianyou commented on September 25, 2024

好的,我先按照您的方法测试一下。
期待Easycanvas的新版本!

from easycanvas.

cyitianyou avatar cyitianyou commented on September 25, 2024

您好!
使用您的修复方法之后,经测试,浏览器内存保持在一个稳定状态,但是GPU的使用率一直接近100%的程度。
目前考虑在不需要的时候使用$app.pause()方法暂停Webgl的渲染,应该能降低GPU的使用率。
感谢您的支持!
image

from easycanvas.

cyitianyou avatar cyitianyou commented on September 25, 2024

试验发现setMaxFps方法更好用一点!

from easycanvas.

c-zhuo avatar c-zhuo commented on September 25, 2024

@cyitianyou 好的,这样的话也可能是mousemove的触发频率太高了,例如一帧触发了多次mousemove。
可以参考
sprite.addEventListener('mousemove', somehandle, 20)
绑定事件,设置触发间隔,单位ms
整个实例的话,可以painter.addEventListener('mousemove', somehandle, 20)

from easycanvas.

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.