Re: time uniform for CSS Shaders

Hi Fabrice,

We actually considered something like the timeElapsed idea you suggest, but we found that it was easy for any filter to have a parameter, e.g., progress, that goes from 0 to 1 during the animation and which gave the progress we needed to key on in the shader code. At least, this was sufficient for all the cases we encountered in our demos and prototypes.

In the following:

#myElement {
filter: custom(url(warp.vs), 20 20, progress 0);
       transition: filter 3s;
}

#myElement {
filter: custom(url(warp.vs, 20 20, progress 1);
}

we get a 'normalized' values in the [0, 1] range. This worked better for us than trying to either do the actual 'timeElapsed' (based on a world clock or a progress scaled by the animation/transition duration).

Cheers,
-v

From: Fabrice Robinet <cmg473@motorola.com<mailto:cmg473@motorola.com>>
Date: Fri, 9 Mar 2012 16:47:28 -0800
To: Rik Cabanier <cabanier@gmail.com<mailto:cabanier@gmail.com>>
Cc: "public-fx@w3.org<mailto:public-fx@w3.org>" <public-fx@w3.org<mailto:public-fx@w3.org>>
Subject: Re: time uniform for CSS Shaders

Hi Rik,

Ah.. yes of course :)...
I was thinking about having a built-in "timeElapsed" uniform specifically for CSS shaders but indeed,
that looks to not fit well the model and not necessary.

Thanks for your quick answer,
Fabrice.

On Fri, Mar 9, 2012 at 3:36 PM, Rik Cabanier <cabanier@gmail.com<mailto:cabanier@gmail.com>> wrote:
Hi Fabrice,

I'm not sure what you are asking. Filters are similar to other properties such as opacity in that they don't happen over time (They apply in 0 time).
The filters spec states that you can use CSS animations and transition to interpolate them over time.
Alternatively, you can change a filter in script.

Does this answer your question?

Rik
Adobe Systems, Inc


On Fri, Mar 9, 2012 at 12:23 PM, Fabrice Robinet <cmg473@motorola.com<mailto:cmg473@motorola.com>> wrote:
Hi group,

I did not find in the spec a uniform to represent time.
While having time to perform variations on any fx is useful,
I was wondering if that omission in purpose to discourage people to do fx that would require update each frame.

Should I file an issue ?

Thanks,
Fabrice.

Received on Saturday, 10 March 2012 02:14:45 UTC