[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] option for suggesting "low power" mode at context creation

On Mon, Oct 1, 2012 at 9:04 AM, Mark Callow <callow.mark@artspark.co.jp> wrote:

On 2012/09/28 20:37, Florian Bösch wrote:
On Fri, Sep 28, 2012 at 4:39 AM, Mark Callow <callow.mark@artspark.co.jp> wrote:

That said,  I agree that global control over power usage belongs in the OS. Given the way the OS X Energy Saver preferences are set up "automatic switching" is the choice that indicates you want to prolong battery life. This thread is happening because automatic switching apparently isn't smart enough.

Well gfx scaling as a function of user preference is not yet considered by any OS, most prominently not by those OSes that introduced it in the first place.
The Energy Saver preference I mentioned above provides exactly that consideration.

So that is part of why scale selection is being discussed here. The other part is that there is knowledge the author of a particular use of WebGL has, that cannot be known or deduced. For instance, I know that my deferred irradiance demo consumes tons of GPU resources, and it has nothing to do with aliasing or running at 60fps.
Define "tons of GPU resources".
Per Frame: Deferred irradiance: render scene albedo TT, render scene depth/normal TT, render scene depth from light TT, gaussian blur scene depth and depth squared TT, deferred shadow map precalculated lightprobe direct irradiance TT, deferred shadow map scene direct light TT, for i in range(3): sum up spherical harmonics for light probes from direct & indirect radiance, update indirect radiance from spherical harmonics, deferred render indirect scene irradiance TT via deferred light propagation values. Combine albedo, direct radiance, indirect radiance for output to display.
My suggested heuristic works fine for these cases.

1) No, because 
var ctx = canvas.getContext('webgl');
$('button').click(function(){ // start doing something expensive with the context requring a discrete GPU })

2) No, because
var ctx = canvas.getContext('webgl');

3) No, because
var ctx = canvas.getContext('webgl');
runSomeCode(ctx); // randomly fails and not fails