W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

RE: New version of mesh branch.

From: Cyril Concolato <Cyril.Concolato@cisra.canon.com.au>
Date: Wed, 8 Feb 2012 03:56:33 +0000
To: Tavmjong Bah <tavmjong@free.fr>, Rik Cabanier <cabanier@gmail.com>
CC: Israel Eisenberg <owlgems@yahoo.com>, www-svg <www-svg@w3.org>
Message-ID: <54EF1DA3171CEE48AD59D7FF0DE043C3567C13CF@exm02-wvp.cisra.canon.com.au>
Hi all,

> -----Original Message-----
> From: Tavmjong Bah [mailto:tavmjong@free.fr]
> Sent: Tuesday, 7 February 2012 7:12 AM
> To: Rik Cabanier
> Cc: Israel Eisenberg; Cyril Concolato; www-svg
> Subject: Re: New version of mesh branch.
> @Israel: In your test at
> http://owl3d.com/tests/Gradient_Mesh/lerpHermite.html , try putting in the
> values [[0,0,0][127,127,127][255,255,255]]. The resulting gradient has visual
> artifacts. In this case you don't want the derivative to be zero at the border. You
> do want the derivative to be the same on both sides and these derivatives may
> be different for the different colors.
@Tav, I think you are right. The Microsoft paper [2] that I cited in the wiki page [1] indicates that a cubic spline is a good match to what Illustrator is doing. What Israel proposes, i.e. a cubic Bezier spline, might be the case. But you want to add additional constraints. The Microsoft paper adds that the cubic interpolation be monotonic. You want to keep monotonicity in the color profile if the color values at consecutive patches corners are monotonic. You probably want the derivative to be zero when the values are not monotonic to avoid overshoot.

@Israel, your explanation is interesting and interestingly it matches a bit the Microsoft paper. A few points intrigue me. The monotonic cubic spline interpolation that the Microsoft paper refers to uses some spline energy minimization. I think your approach based on symmetry is more interesting. But it is unclear to me how it behaves in the general case.

Using a bicubic Bezier patch definition for the color interpolation, you have to find the color value for 16 control points. 4 are being given by the patch corner colors. How would you find the other ones? Note that Microsoft proposes to fit a monotonic cubic curve only on the edges, not inside the patch, therefore there are only 8 color values to find.

I understand that if a patch corner is a local minimum or maximum, in the mesh, for instance in the x direction, then the color of the adjacent control point on that x axis is set to be the same value as the corner. Similarly for the y and the diagonal axis. What happens, when a corner is not a maximum? How would you decide the value of the neighboring control points?

If a corner is not belonging to another patch, apparently setting its neighboring control points to fit a quadratic Bezier curve seems to do the job. Except for the diagonal, that is strange. But that doesn't work if that same corner is also a maximum or a minimum. What do you think?


[1] http://www.w3.org/Graphics/SVG/WG/wiki/SVG2GradientsComments

[2] http://research.microsoft.com/apps/pubs/default.aspx?id=69442

The information contained in this email message and any attachments may be confidential and may also be the subject to legal professional privilege. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is unauthorised and prohibited. If you have received this email in error, please immediately advise the sender by return email and delete the information from your system.
Received on Wednesday, 8 February 2012 03:59:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:50 UTC