On Thu, Aug 20, 2015 at 11:02 PM, Ashley Gullen <ash...@scirra.com> wrote:

> We have tried to implement half-vsync rate ourselves in the past by simply
> ignoring alternate rAFs, but in practice it looked terrible - I guess we
> broke implementation-defined heuristics that expect every rAF call to do a
> similar amount of work. I think it would be more useful if we could
> indicate to the browser what we want to happen given that we *expect* to
> miss the deadline, either:
> 1) display ASAP and callback again ASAP (this appears to be the current
> behavior and allows uneven framerates like 45 FPS)
> 2) drop to half rAF rate (producing a steady 30 FPS on a 60 Hz display).
>

I've heard different application developers give different answers about
which behavior is better. If the answer actually depends on the
application, we could add an API to control this.

When it comes to rAF in a worker, for the reasons above I do not see the
> point in any divergence from what the existing main-thread rAF does, unless
> both are changed. If both are changed I hope it takes in to account
> half-vsync mode. If main-thread rAF is not changed, then the rAF in a
> worker should fire simultaneously with the main-thread rAF (as if
> main-thread rAF posted a message to the worker, minus the latency of
> posting a message) such that a game engine running in a worker can align
> with the main window painting.
>

I agree that we should not pass a deadline parameter and frame-skipping
policy should be the same on a worker as on the main thread. But I wouldn't
describe it as "fire simultaneously with the main thread". For one thing,
if the main thread is blocked by long-running scripts then you could get
more rAF callbacks firing on the worker than on the main thread.

Rob
-- 
lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
toD
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
rdsme,aoreseoouoto
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
lurpr
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
esn

Reply via email to