Giter Club home page Giter Club logo

Comments (5)

hyperandroid avatar hyperandroid commented on July 22, 2024

Hey Kostas,

maybe director.setClear(false) will do it for you.
probably you're having the screen cleared twice, once by the director
(which unless called the previous code will clear the screen) and by the
scene ?
let me know.
Another thing, i've just uploaded regarding behavior transformation into
css3 keyframes. i'm focusing on this issue since i'm also targeting mobile
dev. even though css3 animations totally suck, i'm getting good results.

-i

2011/11/23 Kostas Karolemeas <
[email protected]

In Director.render, the initialization code (canvas clear, etc) is ran
even if all calls to Scene.isInAnimationFrame return false. A proposed
solution:

   ...
   var initialized = false;
   if (this.glEnabled) {
       for (i = 0; i < ne; i++) {
           var c = this.childrenList[i];
           if (c.isInAnimationFrame(this.time)) {
               if (!initialized) {
                   this.gl.clear(this.gl.COLOR_BUFFER_BIT |

this.gl.DEPTH_BUFFER_BIT);
this.coordsIndex = 0;
this.uvIndex = 0;
initialized = true;
}
...
} else {
for (i = 0; i < ne; i++) {
var c= this.childrenList[i];
if (c.isInAnimationFrame(this.time)) {
if (!initialized) {
this.ctx.globalAlpha = 1;
this.ctx.globalCompositeOperation = 'source-over';

                   if (this.clear) {
                       this.ctx.clearRect(0, 0, this.width,

this.height);
}
initialized = true;
}
...
}

(I am working on a project that will also target mobile devices where CPU
consumption results to battery consumption :-))


Reply to this email directly or view it on GitHub:
#19

from caat.

VoxelPerfect avatar VoxelPerfect commented on July 22, 2024

Hi Ibon,

I am afraid setClear(false) creates some artifacts and I think the scene is not clearing the screen, at least I have not added any code to do that.

I will give a try to the CSS renderer and let you know!

Kostas

from caat.

hyperandroid avatar hyperandroid commented on July 22, 2024

ok.
will check scene status then.
thanks.

-i

2011/11/23 Kostas Karolemeas <
[email protected]

Hi Ibon,

I am afraid setClear(false) creates some artifacts and I think the scene
is not clearing the screen, at least I have not added any code to do that.

I will give a try to the CSS renderer and let you know!

Kostas


Reply to this email directly or view it on GitHub:
#19 (comment)

from caat.

VoxelPerfect avatar VoxelPerfect commented on July 22, 2024

Look what I did:

  1. called director.setClear(false)
  2. implemented scene.paint to call ctx.clearRect

Now it works! Is this the recommended way to do it?

In parallel, I have started reading the Sumon code :-)

from caat.

hyperandroid avatar hyperandroid commented on July 22, 2024

hey Kostas,
send me a personal email.

-ibon

2011/11/23 Kostas Karolemeas <
[email protected]

Look what I did:

  1. called director.setClear(false)
  2. implemented scene.paint to call ctx.clearRect

Now it works! Is this the recommended way to do it?

In parallel, I have started reading the Sumon code :-)


Reply to this email directly or view it on GitHub:
#19 (comment)

from caat.

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.