Proposed wording for 'how object transforms affect gradient rendering output'


In relation to the discussion on "gradient userSpaceOnUse" [1] and the 
investigation I did on "how authoring tools apply object transforms to 
gradients" [2], I have devised some wording to put in (possibly) current and 
future SVG specifications.

I propose adding the following wording and diagrams for the different parts in 
the gradient section:

Wording to be placed after the first paragraph of the introduction for gradients 
[3] (in SVG Tiny 1.2)

The angle of the color transitions along the gradient vector is defined by the 
gradient normal (see diagram below). Initially, the gradient normal is 
perpendicular with the gradient vector and is the same magnitude as the gradient 
vector. If an object references a gradient, conceptually the object should take 
a copy of the gradient vector and gradient normal and treat it as part of its 
own geometry. Any transformations applied to the object geometry also apply to 
the copied gradient vector and gradient normal. Any gradient transforms that are 
specified on the reference gradient are applied after object transformations 
have been applied but prior to rendering.

The wording in the last sentence of the second last paragraph for gradientUnits 
attribute [4] should be reworded to:

When the object's bounding box is not square, the gradient normal which is 
initially perpendicular to the gradient vector within object bounding box space 
shall render non-perpendicular relative to the gradient vector in user space. 
This transformation is due to application of the non-uniform scaling 
transformation from bounding box space to user space.

Note that this wording is a first draft and open to discussion. To my understand 
of the issue, there are some implementations that have an alternative method of 
applying transforms and thus producing a different result. I can sympathise that 
this wording is potentially contentious, but given that gradients are an 
integral part of any graphics language, a consensus must be reached on this 
issue so all implementations will produce the same result.




Received on Thursday, 4 February 2010 04:58:51 UTC