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

Re: [css shaders] comment on grid dimensions

From: Vincent Hardy <vhardy@adobe.com>
Date: Tue, 4 Oct 2011 16:46:00 -0700
To: Dean Jackson <dino@apple.com>, Chris Lilley <chris@w3.org>
CC: FX <public-fx@w3.org>
Message-ID: <CAB0E693.1B4CF%vhardy@adobe.com>
From: Dean Jackson <dino@apple.com<mailto:dino@apple.com>>
Date: Mon, 3 Oct 2011 20:53:17 -0700
To: Chris Lilley <chris@w3.org<mailto:chris@w3.org>>
Cc: FX <public-fx@w3.org<mailto:public-fx@w3.org>>
Subject: Re: [css shaders] comment on grid dimensions


On 04/10/2011, at 8:38 AM, Chris Lilley wrote:

Hello FX,
This is a comment on
https://dvcs.w3.org/hg/FXTF/raw-file/tip/custom/index.html
In section 3.2.1. The ’vertexMesh' attribute, note 8 it says
  It may be confusing to have the vertexMesh attribute represent the
  number of additional lines and columns. May be it should simply be
  the number of lines and columns, default to 1 1 and require integral
  values equal or superior to 1.
I agree it could be confusing, and I think it would be better to have
the default be 1 1, meaning a grid of one row and
one column.
So if I want a 7x4 grid I can just say 7 4 instead of 6 3.
CSS can and does restrict <number> values to positive numbers if
needed (positive meaning zero is not allowed; the alternative is
non-negative, which allows 0,1,2 etc).

I agree with Chris here. By default you should get a simple quad ("1 1" = 2 x 2 vertices), and think in terms of the holes in the grid, not the points.

ok and I agree. I added the issue to the issue page for shaders.


However, I wonder why we even need to specify this alongside a reference to a shader. Do we expect authors to change this? It won't necessarily mean a better output with a higher input. I have a feeling that most effects will written with an assumption of some vague size of mesh input. Maybe it could be combined into the shader itself (or provide a default if the mesh isn't specified in the property)?

Or putting it another way, I could write a wave effect using a vertex shader or a fragment shader, or both. The vertex shader approach requires a mesh - the fragment shader approach does not. It would be nice if in both cases the author could just say filter: shader("wave") and get a nice default result.

So you are thinking of a way for the shader source to contain the mesh size it wants. In the examples we worked on, the mesh size depends on what the shader does and the resolution (pushed to the extreme, on a 1x1 image, we would not need more vertices). So if we put this in the shader itself, then it may have to be a function of the input size.

May be we could balance this with a shader having a default mesh size and the author having the ability to override the default?

Vincent
Received on Tuesday, 4 October 2011 23:46:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 4 October 2011 23:46:33 GMT