Hi Mark,

It would be really difficult for me to explain Java 2D's
rasterization process in a couple sentences, but... For thin lines,
we have ways to flatten curves in software and then we basically pass
those line segments down to OpenGL to be rendered as a
GL_LINE_STRIP.  For anything more complex (non-thin stroked paths,
filled shapes) we either break the shape down into scanlines (in the
non-AA case) or go through a more complex path that produces coverage
tiles and so forth (in the AA case), all of which get passed down to
OpenGL through various codepaths.

You can probably get fairly far with the techniques you described,
but it really depends on how complex the geometry is that you're
trying to render.  And if you care about rendering quality (which you
probably do), be aware that the quality of OpenGL's multisampling
facilities doesn't even compare to Java 2D's antialiasing quality.

Rather than you opening up a can of worms, may I suggest a possibly
simpler approach?  For what you've described, I think you should be
able to use the TextureRenderer (or Overlay) class that we've
provided in our JOGL distribution; see my recent blog entry for more
info:
http://weblogs.java.net/blog/campbell/archive/2007/01/
java_2d_and_jog.html

The scenario you describe is exactly what we created these classes
for.  Let me know if you decide to try this approach; feedback would
be appreciated.

Thanks,
Chris

On Apr 7, 2007, at 7:47 AM, Mark McKay wrote:
Not strictly a Java2D question, but I thought I'd ask here because
there
are a lot of knowledgeable people who've worked on the OpenGL 2D
pipeline.

I'm writing an application in JOGL and need to draw some curved 2D
shapes (with an orthographic view, so they will appear to overlay the
rest of the scene).  Effectively, I want to emulate the
Graphics2D.draw(Shape) and Graphics2D.fill(Shape).  Some of these
shapes
will be defined by connected Bezier curves (similar to a GeneralPath).
What's the best way to render such a shape in OpenGL?  I can subdivide
each of the Bezier segments into smaller segments until the resolution
is small enough to approximate it with straight line segments - but
that
would lead to an extremely tessellated shape.  And how would I
emulate a
stroked outline?  Convert the outline to a Shape first?  How did the
Java2D team tackle this?

Mark McKay

======================================================================
=====
To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
of the message "signoff JAVA2D-INTEREST".  For general help, send
email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to