[cairo] Fwd: Fractals and procedural generation

Bryce Harrington bryce at osg.samsung.com
Tue Sep 5 19:12:19 UTC 2017

On Fri, Sep 01, 2017 at 03:03:39PM +0200, Soul Cycle wrote:
> Are you asking if you would be permitted to implement this for Cairo?
> > I'm not sure whether we'd take a patchset that added this, but I'd
> > certainly be open to a more detailed technical proposal of how you'd
> > code it.
> >
> I'm sorry. I wouldn't be able to do this. Apophysis has some new classes of
> fractals which I would like to operate with in Inkscape.

Gotcha.  Sadly we wouldn't be able to do it either, as the Cairo team is
very short on development resources these days.  Even if we weren't I'm
not sure this is really in scope for Cairo's focus, so like I mentioned
even if a viable patch to add the feature was available, I'm not sure if
we'd take it or not.

> > >    2. Could you consider implementing framework for 3D pathtracer as
> > >    Mandelbul3D or Fragmentarium ?
> > >        https://github.com/3Dickulus/FragM
> > >        http://blog.hvidtfeldts.net/
> >
> > That looks like a large amount of code for a fairly specific
> > functionality, what is your thinking as to why it would need to be in
> > Cairo?
> Some of the Illustrator abilities have implemented 3D raster engine to
> rendering lights and shadows and manipulating curves in 3D space.
> I was wondering if this pathtracer would be useful for Inkscape to render
> projections of 3D procedural objects as 2D splines, curves ?
> Basically, make more procedural and CAD like features in Inkscape.

Ah, I think I understand.  I'm not sure we're likely to do exactly that,
but I've been poking at a feature for expanding Cairo's path effects
support, which might enable doing things of this sort.  My own
objectives there include gaussian-blur shadows, and possibly some
boolean path ops (union, difference, xor, etc.) for applying multiple
effects to a path.  But that work is low priority for me and may be a
while before I have code to look at.  This involves adding a large API
so will probably take quite a few review iterations to get right.

I also have code I'm working on at slightly higher priority to add
projective transform effects, not true 3D but like 2.5D.  That'd allow
some basic 3D effects like "star wars text", drawing 3D-ish boxes, etc.
I'm hoping to get this landed on trunk this year but we'll see.  This
would add a new matrix transformation API to permit this, which could
get a bit involved.

But even these efforts are shooting for fairly basic 3D effects; stuff
like light positioning and procedural objects are not in scope for what
I'm working on myself; perhaps maybe follow on work for someone though.
If this is important to you I'd recommend chatting with the Inkscape

Now, taking off my Cairo developer hat, and putting on my Inkscape
developer hat.  We certainly do a lot of path effects in Inkscape, and
may be able to do some more 3D-ish stuff (outside Cairo, potentially
even using 3rd party libs, I'm not sure).  The person to talk to is
Jabier (jabiertxof on IRC); if there's a way to do it he can usually
figure out how - bring him images demonstrating what you're aiming for.

> I've wondered about Vulkan myself.  Do you use the OpenGL backend
> > currently?  What is your interest in Vulkan, that wouldn't already be
> > met by the current GPU support?  I posted a patchset to upgrade our
> > OpenGL ES to version 3.0 a few weeks back, which may provide some of
> > those benefits.  Did you have a chance to look at or test it?
> >
> > As to OpenCl, what would your thoughts be on how Cairo would make use of
> > it?
> >
> I'm sorry again. I'm more an artists who likes to draw in Inkscape. I was
> wondering about Vulkan to improve rendering for high density curves and
> paths and for viewport performance.

Okay, I see.  Be careful you're not taking these as just catch phrases
or marketing.  OpenCl is just a way to use the GPU as a secondary CPU
for computation needs (unrelated to graphics).  Vulkan is a
rearchitecting of OpenGL to gain better performance in 3D applications;
Cairo and Inkscape are 2D, so it's unclear if the changes would bring
benefits or not.  I don't know OpenGL deeply enough to make an educated
guess, but my uneducated guess is probably not.

(Cairo hat)
Inkscape does not use the Cairo OpenGL backend presently.  If they did,
then most of what you're looking for in Vulkan would be available to
you.  More applications like Inkscape need to start using it so we can
improve the performance and work out bugs.

(Inkscape hat)
Unfortunately Cairo supports the OpenGL backend as experimental-only,
and most Linux distros don't ship it enabled by default so it's
inaccessible for users.  Because of this, it's performance and stability
have not been widely tested in production, so enabling it for Inkscape
seems pretty risky and might just be trading one set of issues for


More information about the cairo mailing list