W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css-shaders] render size?

From: Chris Marrin <cmarrin@apple.com>
Date: Tue, 25 Oct 2011 09:53:00 -0700
Cc: www-style list <www-style@w3.org>
Message-id: <8E4595AD-8CBE-44B1-8BA1-DFCF5C4E462B@apple.com>
To: Gregg Tavares <gman@google.com> (wrk)

On Oct 24, 2011, at 9:59 AM, Gregg Tavares (wrk) wrote:

> How do you specify the resolution of the texture the CSS-shader renderer elements will be rendered too?
> 
> If I apply a CSS-shader to 100x100 pixel element, I can just put 
> 
>   gl_Positoin = u_projectionMatrix *  a_position * 100.0;
> 
> In order to render that element I now need a 10000x10000 texture. At least as I currently understand it. That element could be 3D CSSed to project into the background so I don't want to see it's edges cut off. It also needs to get composited with other elements on the page so I can't just "render to the backbuffer".

The filter operates on the contents of an element so the input texture would be 100x100 in your example. The results are conceptually placed on a new surface which is the size of the element, plus any area added by the 'filter-margin' property. So you can make an arbitrarily large output surface, but it would still only have a 100x100 texture to work with. 

Perhaps it would be reasonable to have a 'textureSize' param to allow you to specify the rendered input texture size. We'd want to write the spec to allow limiting the texture size if values were provided that would produce a texture that is too large for the system.

-----
~Chris
cmarrin@apple.com
Received on Tuesday, 25 October 2011 16:54:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT