Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL deterministic rendering between GPU vendor

I'm currently programming a scientific imaging application using OpenGL.

I would like to know if OpenGL rendering (in term of retrieved pixel from FBO) is supposed to be fully deterministic when my code (C++ / OpenGL and simple GLSL) is executed on different hardware (ATI vs NVidia, various NVidia generations and various OS)?

More precisely, I'd need the exact same pixels buffer everytime I run my code on any hardware (that can runs basic GLSL and OpenGL 3.0)...

Is that possible? Is there some advice I should consider?

If it's not possible, is there a specific brand of video card (perhaps Quadro?) that could do it while varying the host OS?

like image 620
softmllx Avatar asked Oct 27 '11 21:10

softmllx


2 Answers

From the OpenGL spec (version 2.1 appendix A):

The OpenGL specification is not pixel exact. It therefore does not guarantee an exact match between images produced by different GL implementations. However, the specification does specify exact matches, in some cases, for images produced by the same implementation.

If you disable all anti-aliasing and texturing, you stand a good chance of getting consistent results across platforms. However, if you need antialiasing or texturing or a 100% pixel-perfect guarantee, use software rendering only: http://www.mesa3d.org/

like image 95
user57368 Avatar answered Sep 28 '22 12:09

user57368


By "Deterministic", I'm going to assume you mean what you said (rather than what the word actually means): that you can get pixel identical results cross-platform.

No. Not a chance.

You can change the pixel results you get from rendering just by playing with settings in your graphics driver's application. Driver revisions from the same hardware can change what you get.

The OpenGL specification has never required pixel-perfect results. Antialiasing and texture filtering especially are nebulous parts.

like image 37
Nicol Bolas Avatar answered Sep 28 '22 13:09

Nicol Bolas