We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Slow Performance in Fullscreen--OSX
Page Index Toggle Pages: 1
Slow Performance in Fullscreen--OSX (Read 2346 times)
Slow Performance in Fullscreen--OSX
Dec 22nd, 2009, 9:28am
 
Hi, I'm experiencing a big (2x?) slowdown when I run this sketch in fullscreen.

I'd like to get it running in fullscreen without the slowdown, but something seems to be happening at a level beyond my understanding. I can upload source if you like.

Here are two downloads, the *only* difference between them is I've edited the LSUIPresentationMode in the plist to turn on fullscreen mode (I think this is how processing implements present mode on OSX).

Not Fullscreen (fast):
http://robseward.com/documentation/games/kunst_bauen/KUNST_BAUEN.zip

Fullscreen (really slow):
http://robseward.com/documentation/games/kunst_bauen/KUNST_BAUEN_fullscreen.zip

I'm on a 2.4gHz Macbook Pro 15" running Snow Leopard, and Processing 1.0.9

Many thanks!


Rob

P.S., I don't remember having this problem with an earlier version of Processing and OSX. That is, in Tiger with Processing 135 this wasn't an issue.
Re: Slow Performance in Fullscreen--OSX
Reply #1 - Dec 23rd, 2009, 9:11am
 
Hi,

I have tried both apps and haven't noticed any speed difference.

Tested on Macbook Pro 2.33GHz and ATI Mobility 1600XT 256MB
running OS X 10.6.2

If i'm not wrong your Mac has an NVIDIA GFX Card, so it might be related to the drivers.

You can try to use the Fullscreen library instead of present mode.

http://www.superduper.org/processing/fullscreen_api/
Re: Slow Performance in Fullscreen--OSX
Reply #2 - Dec 28th, 2009, 7:22am
 
This may be an issue that is tied to Snow Leopard.
http://processing.org/discourse/yabb2/num_1251744370.html

I had hoped that 10.6.2 was going to increase the speed, but I couldn't tell a difference.  10.5 has always been faster for me with regard to Processing (even on older hardware).
Re: Slow Performance in Fullscreen--OSX
Reply #3 - Dec 28th, 2009, 11:12am
 
Thanks. I'll try installing java 1.5. I know that in processing 135 this ran much faster than in 1.0, and now (that I'm in Snow Leopard? Java 1.6?) it won't compile in 135. This might fix the problem here.

And Jaylfk, thanks.  I tried the fullscreen library and got the same results. Hmmmm....
Re: Slow Performance in Fullscreen--OSX
Reply #4 - Dec 28th, 2009, 12:01pm
 
It is really strange because i don't get any slow down on my ATI.

It might be related to 10.6 NVidia drivers.
Re: Slow Performance in Fullscreen--OSX
Reply #5 - Dec 28th, 2009, 12:37pm
 
Aha! I found a fix, but it's weird!

It appears that, in fullscreen mode, there's a 30fps cap if the app is the same size as the screen. If I set the screen to:

size(screen.width, screen.height - 1, OPENGL);

The frame rate goes back up to 60 fps. I modified example 3d app BrickTower to test it on another app. I got the same results. Are people getting the same their computers? :

Code:
  import processing.opengl.*;

float bricksPerLayer = 16.0;
float brickLayers = 18.0;
Cube brick;
float brickWidth = 60, brickHeight = 25, brickDepth = 25;
float radius = 175.0;
float angle = 0;
int drawTime = 0;  //for fps

void setup(){
 size(screen.width, screen.height, OPENGL); //30 FPS
 //size(screen.width, screen.height - 1, OPENGL); //60 FPS!!!
 brick = new Cube(brickWidth, brickHeight, brickDepth);
}



void draw(){
 background(0);
 float tempX = 0, tempY = 0, tempZ = 0;
 fill(182, 62, 29);
 noStroke();
 // Add basic light setup
 lights();
 translate(width/2, height*1.2, -380);
 // Tip tower to see inside
 rotateX(radians(-45));
 // Slowly rotate tower
 rotateY(frameCount * PI/600);
 for (int i = 0; i < brickLayers; i++){
   // Increment rows
   tempY-=brickHeight;
   // Alternate brick seams
   angle = 360.0 / bricksPerLayer * i/2;
   for (int j = 0; j < bricksPerLayer; j++){
     tempZ = cos(radians(angle))*radius;
     tempX = sin(radians(angle))*radius;
     pushMatrix();
     translate(tempX, tempY, tempZ);
     rotateY(radians(angle));
     // Add crenelation
     if (i==brickLayers-1){
       if (j%2 == 0){
         brick.create();
       }
     }
     // Create main tower
     else {
       brick.create();
     }
     popMatrix();
     angle += 360.0/bricksPerLayer;
   }
 }
 println(calcFPS());
}

int calcFPS(){
 int diff = millis() - drawTime;
 int fps = (int)(1000/ float(diff));
 drawTime = millis();
 return fps;
}




And for the record, I tried installing java 1.5. That allowed me to run the app in Processing 135, but it didn't produce any performance gains. I still got the 50% slowdown when I ran the app in present mode, no matter what the Java version or Processing version.

And I'm on a MBP 2.4gHz 4GB GeForce 8600M GT.

Re: Slow Performance in Fullscreen--OSX
Reply #6 - Jan 21st, 2010, 10:47am
 
THANK YOU SO MUCH
that problem nearly killed me.........

thanks :D

* pandrr happy now
Re: Slow Performance in Fullscreen--OSX
Reply #7 - Jan 21st, 2010, 10:54am
 
Ah... yes.. I noticed this earlier this month.  We have a ticket open on it.  
http://dev.processing.org/bugs/show_bug.cgi?id=1425

Sorry, should have thought to post this answer earlier.
Page Index Toggle Pages: 1