[cairo] Fwd: Re: [Mesa3d-dev] more glitz points
c99drn at cs.umu.se
Wed Apr 21 11:05:39 PDT 2004
On Wed, 2004-04-21 at 12:25 -0600, Brian Paul wrote:
> David Reveman wrote:
> > On Wed, 2004-04-21 at 09:33 -0700, Jon Smirl wrote:
> >>--- Brian Paul <brian.paul at tungstengraphics.com> wrote:
> >>>> Most programmatic surfaces are implemented using fragment programs and
> >>>> they will only be available on hardware supporting the fragment program
> >>>> extension.
> >>>You certainly don't need fragment programs to do color gradients like
> >>>those. At worst, you have to just compute per-vertex texcoords to do
> >>>radial gradients. You can use texgen for texcoords for linear
> >>>gradients. I've done both in past projects (long before fragment
> >>>programs existed).
> > You're probably right, and I'd love if someone would contribute with
> > some code that could do this. Although I think it might be hard make it
> > work with glitz's rendering model (the xrender model). It might also be
> > hard to make it support the different spread types; pad, repeat and
> > reflect.
> Pad, repeat and reflect sound like OpenGL's GL_CLAMP, GL_REPEAT and
> GL_MIRRORED_REPEAT texture wrap modes.
This is actually what I'm using with the current version of glitz. I
calculate a gradient offset value in the fragment program, then use it
to fetch a pixel from a 1D texture with one of the above mentioned
texture wrap modes.
> I could probably whip up a GLUT demo showing various kinds of gradient
> rendering. Would that help?
That would be great. I hope that's not to much trouble for you. This way
I could easily see how it would be possible to improve glitz's gradient
David Reveman <c99drn at cs.umu.se>
More information about the cairo