caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jon Harrop" <jon@ffconsultancy.com>
To: "'Peter Ronnquist'" <peter.ronnquist@gmail.com>, <caml-list@inria.fr>
Subject: RE: [Caml-list] f#/mono vs ocaml runtime system - open gl animation screen tearing.
Date: Wed, 27 Apr 2011 11:02:36 +0100	[thread overview]
Message-ID: <026b01cc04c2$3cac40b0$b604c210$@ffconsultancy.com> (raw)
In-Reply-To: <BANLkTikK2CLn1zoeA2i8DSMdCoEFsO9j6g@mail.gmail.com>

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


  parent reply	other threads:[~2011-04-27 10:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 19:15 Peter Ronnquist
2011-04-26 19:30 ` Gabriel Scherer
2011-04-26 20:16   ` Peter Ronnquist
2011-04-26 19:39 ` Török Edwin
2011-04-26 20:37   ` Anthony Tavener
2011-04-27  6:51 ` rixed
2011-04-27 10:02 ` Jon Harrop [this message]
2011-04-27 21:08   ` Peter Ronnquist
     [not found] <fa.bAPY0rzAUUqrEHcCwn9toRc5oMo@ifi.uio.no>
2011-04-26 20:38 ` Ethan Burns
2011-05-01 14:24 Peter Ronnquist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='026b01cc04c2$3cac40b0$b604c210$@ffconsultancy.com' \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@inria.fr \
    --cc=peter.ronnquist@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).