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.