W3C home > Mailing lists > Public > public-fx@w3.org > October to December 2011

[css shaders] Request for additional UA uniform variables

From: Chris Subagio <chris.subagio@gmail.com>
Date: Wed, 12 Oct 2011 10:16:52 -0700
Message-ID: <CACCxRUAe=-5TfuV8fHv8JH3micqgEr7_RNX1sjKf4eX5WtGVhg@mail.gmail.com>
To: public-fx@w3.org
Hi. Let me preface this by saying that I'm thrilled by this proposal. It
sounds like a great way to leverage the hardware directly, and as video game
programmer it rang all kinds of happy bells.

I'd like to call attention to two additional uniforms that I think might be
very useful.


First, I'd like you to consider a clock parameter.

This would be a constantly increasing value that you could use for ambient
animations, like say a waving flag or lapping waves.

Ideally this u_clock would be something like a (float) seconds since 1970,
unix style. Someone might find a neat use for the actual absolute time,
versus just an incrementing number. Unfortunately the precision on these
constant registers can vary wildly from hardware to hardware, and it's
unlikely that such large numbers would work. So perhaps running time since
page load would be sufficient, with some way to also pass in the absolute
clock time when the page was loaded?

As an optimization, the clock parameter could be an option enabled from the
filter declaration (defaulted to off!), effectively switching the element
from a transition only animation to an ambient animation.



The second parameter I'd like to propose is one to map from the filter space
back to page space.

I believe the currently proposed model operates on the notion that the
filter region represents the actual render target surface, and that the
projection matrix maps the 0-1 box model space onto that render target. What
I'm looking for is an additional constant to let me map from this space back
to the original page space, preferably back in units of pixels.

The idea is that with the knowledge of where you are on the page, you could
do a number of interesting coordinated things, like apply animations that
sweep across disparate elements on the page, or have filters that react to
moving an element on the page using other CSS means. In effect, each
separate element on the page would be a window into the effect space.

Visualize a movie trailer page about hurricanes in which the corners of some
panels flap in the wind. Gusts could travel across the page, hitting each
corner in turn, creating a coordinated sense of motion without turning the
whole page into one big effect.



I hope that made sense. Good work, and good luck getting this one across the
finish line!

'Chris.
Received on Friday, 14 October 2011 22:11:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 14 October 2011 22:11:43 GMT