FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   Beginner osx big screen size = slow and flicker
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Beginner osx big screen size = slow and flicker  (Read 561 times)
Tommi


Beginner osx big screen size = slow and flicker
« on: Feb 11th, 2004, 1:44am »

Hi,  
 
I'm quite new to processing and come from a director/flash background. Because of the speed of Processing I thought it might be a good idea to try to code my next little app in processing.
But I ran into the following problem.
 
Here is my really basic test code:
 
void setup () {
 
  size(800,600);
  background(#000000);
 
}
 
void loop() {
   
  background( #000000 );
  my_x = (my_x + 5) % width;
  my_y = (my_y + 5) % height;
  ellipse(my_x, my_y, 55, 55);
   
}
 
The problem is that as soon I increase the screen size, the ellipse slows more and more down and I get a kind of flickering effect of the ellipse as it moves (in processing and in the browser). I showed it to a java coding friend of mine and he said something about a tearing effect, which I cant really believe but didnt really know an answer.
 
Is processing not at all meant for bigger sketch sizes? I want to code a vj app and want to run it in something like 800*600. I tried the same code at my mac at work and it runs already better but this comp is also a lot faster.
 
For fun I added the getMeterLevel() code from the sonia examples, because thats what i want to work with, and then the whole thing ran even a lot slower, any mouse input has been delayed for almost a sec, the input meters appeared almost a sec after the sound playing. Plus there were random screen refreshs or black and white 'patterns' inside the applet.
 
Maybe its a problem of my particular computer,  
 
Here my specs:  
 
mac g4 555 osX 10.3.2 DevTools installed
 
Processing 068 alpha
 
Sonia 2_5
 
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-117.1)
Java HotSpot(TM) Client VM (build 1.4.2-34, mixed mode)
 
 
Any help greatly appreciated, I don't want to move back to director,
 
Tommi
 
 
 
 
arielm

WWW
Re: Beginner osx big screen size = slow and flicke
« Reply #1 on: Feb 11th, 2004, 2:05am »

processing can be much faster than director or flash, but some issues have to be taken in count (mainly, it's about the difference between the "engine" and the "programming language"):
 
 
1a) everything in processing is coded in java, which is slower than native code (i.e. usually c/c++ or even better: asm, not to mention: hardware-acceleration)
 
1b) in dir and fla: every non lingo or actionscript part is done with native code
 
 
2a) processing is based on a framebuffer (a huge array of pixels) which is updated at each frame, no matter what you do on screen.
 
2b) dir and fla generally use some smart clipping methods (i.e. only things that changed are actually updated)
 
 
the point to understand:
 
- java, the language used in processing is much faster than lingo or actionscript
 
- the processing engine is slower than director or flash engines
 
 
the bottom line, grosso-modo:
 
- if you move filled circles on a huge screen, director or flash will win (because they have a native method to fill circles and they do smart clipping...)
 
- if you want to deal with a zillions of other things that require a lot of lines of custom code to be executed in real time: processing will make it.
« Last Edit: Feb 11th, 2004, 2:06am by arielm »  

Ariel Malka | www.chronotext.org
REAS


WWW
Re: Beginner osx big screen size = slow and flicke
« Reply #2 on: Feb 11th, 2004, 2:21am »

Put simply, Processing is better at "processing" and Flash / Director are faster at "drawing".
 
Tommi


Re: Beginner osx big screen size = slow and flicke
« Reply #3 on: Feb 11th, 2004, 2:25am »

Okay thanks a lot arielm and Reas, this clarifies everything already a lot.
 
So as long as I have graphic objects moving, like gif animations, you would suggest its better to stick to director.  
I first started to try some pixel video code in processing thats maybe why I thought everything will be faster if I move completly to Processing.
 
It's a pitty though as my idea was to mix a little pixel effects and classic hand-drawn animation. I mean every 2d game is a mixture of animated sprites and some pixel code.  
Should I maybe use techniques like buffering?
 
but thx again
 
oh
« Last Edit: Feb 11th, 2004, 2:52am by Tommi »  
Pages: 1 

« Previous topic | Next topic »