From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3RA2tci009559 for ; Wed, 27 Apr 2011 12:02:55 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkICAJPot03Unwcji2dsb2JhbACYDI1fFAEBAQoLCwcSBiHDBYV2BJJjg26GLQ X-IronPort-AV: E=Sophos;i="4.64,273,1301868000"; d="scan'208";a="98161018" Received: from relay.ptn-ipout01.plus.net ([212.159.7.35]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 27 Apr 2011 12:02:49 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAFbpt01UXebj/2dsb2JhbACYDI1fd8MDhXYEkmODboYt Received: from outmx01.plus.net ([84.93.230.227]) by relay.ptn-ipout01.plus.net with ESMTP; 27 Apr 2011 11:02:49 +0100 Received: from [80.229.123.248] (helo=WinEight) by outmx01.plus.net with esmtp (Exim) id 1QF1a4-0004BZ-MG; Wed, 27 Apr 2011 11:02:48 +0100 From: "Jon Harrop" To: "'Peter Ronnquist'" , References: In-Reply-To: Date: Wed, 27 Apr 2011 11:02:36 +0100 Message-ID: <026b01cc04c2$3cac40b0$b604c210$@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJK/CiJzF9mM63es1qJV9KB77xvSZNzimUQ Content-Language: en-gb Subject: RE: [Caml-list] f#/mono vs ocaml runtime system - open gl animation screen tearing. Hi Peter, Sorry for the late response. I have done a lot of OCaml+OpenGL work over the years and found it to be extremely good for smooth animation. Conversely, I have been uniformly unimpressed with Mono. Frame update during animations should be synchronized with the vertical refresh of the display to prevent tearing. Therefore, if you are seeing torn images then the problem is certainly with the way OpenGL is being setup or used and not to do with OCaml's GC or other user-land problems. The visualization samples from my book OCaml for Scientists are freely available: http://ffconsultancy.com/products/ocaml_for_scientists/visualisation/index.h tml The "Simple 2D animation" program should provide a spinning triangle with no tearing thanks to the use of double buffering and the GLUT swap buffers command to update the animation in sync with the display. Cheers, Jon. > -----Original Message----- > From: Peter Ronnquist [mailto:peter.ronnquist@gmail.com] > Sent: 26 April 2011 20:16 > To: caml-list@inria.fr > Subject: [Caml-list] f#/mono vs ocaml runtime system - open gl animation > screen tearing. > > Hi all, > > I have been experimenting with f# and mono on debian linux and compared it > with ocaml. > I am interested in visual presentations for example games and in my tests f# + > mono + opentk was able to make completely smooth animations using opengl > (opentk) on debian 6.0 (squeeze). > > Ocaml + lablgl gives "stutters" in the animation within the period of a couple of > seconds. The animation runs smooth for a couple of seconds and then the > animation update is disturbed with the result that the image is "teared". The > tearing lasts only for a fraction of second but is visible for a trained eye. > > I suspected that the GC could be a cause for this and I tried to manipulate the GC > settings but I could not get a completely smooth animation for a longer period > of time. > > This is completely acceptable for many applications but for making a game or > for the meticulous graphical applicaton user it is not ideal. > > My thought is that maybe f#/mono unboxes more values than ocaml and in this > way the GC doesn't need to work as hard? > > My question really is if you think it is worthwhile to investigate the runtime > system for mono and compare it with the runtime system for ocaml to locate > the differences that might influence the animation and then even update the > ocaml runtime system to use a similar strategy as the f# runtime system? > > I would be interested in this but it would be nice to first hear from the list if this > is a good idea. I also read in the Jane Street blog > (http://ocaml.janestreet.com/?q=node/89) that ocamlpro might work on the > ocaml runtime system (including unboxing). > > Best Regards > Peter Ronnquist > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs