Three.js - Higher Frame Rate

1.7k views Asked by At

I'm using Three.js in combination with Nvidia's 3D Vision shutter technology. The way I do the rendering is as it follows:

// Init 3D Vision Camera (Shutter Glasses)
var eye_separation = 0.03; // adjust to the distance of your eyes
var cam_toggle = true;

function animate() {

    // Enable 3D Vision
    if (cam_toggle) {
        camera.position.x += eye_separation;
        cam_toggle ^= 1;
    } else {
        camera.position.x -= eye_separation;
        cam_toggle ^= 1;
    }

    renderer.render(scene, camera);
    requestAnimationFrame(animate);
}

Basicly what I found out is that the frame refresh rate of the GPUs is the same and synchronized like the shutter glasses. To generate the stereoscopic effect I just toggle the camera between a certain view that changes on the x-axis in this example. This works very well! Nvidia describes in it's documentation to use a frame buffer to toggle the two different views what I don't do. The problem is, that I only got 60 fps at max. But I'm using a 120 Herz projector. So how can I accelerate the rendering for each view up to 60 fps so that I get 120 in combination?

1

There are 1 answers

0
Martin Schuhfuß On

According to this answer here and its source here running the animation-loop at 120Hz should work if the monitor is running at 120Hz.