To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9909
9908  |  9910
Subject: 
Re: LDGlite and LPub (and maybe ldview?
Newsgroups: 
lugnet.cad.dev
Date: 
Fri, 15 Oct 2004 15:38:40 GMT
Viewed: 
2103 times
  
In lugnet.cad.dev, Don Heyse wrote:
In lugnet.cad, Travis Cobbs wrote:
As for solving the problem, I'm not sure what would be best.  You
could always go back and draw the lines a second time with blend func
set to GL_ONE, GL_ONE, depth test disabled and glColorMask set to
GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE.  This should get rid of the
unwanted transparency in the middle of the image, but it would also
remove the antialiasing of the alpha channel around the edges.

Let's see if I understand what's going on here.  When I antialias
the edge lines, the RGB colors buffer gets blended, and so does the
alpha channel.  If alpha was all zeros, now instead of all ones, it
gets something in between.  I think what I really want is to run
a filter over the alpha channel and convert any nonzero numbers
to all ones before dumping the transparent png.  But you're right, it
would be nice to leave the alpha bits for outer edge lines fuzzy so
they blend in with whatever background the transparent png is laid
over.  I think there's an opengl halo trick that might help out here.
Perhaps something to do with the stencil buffer?

Ack!  More reading...

Ok i did a quick once over of glBlendFunc manpage and it looks like
switching line antialiasing from:

  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

to

  glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE_MINUS_SRC_ALPHA);

eliminates the problem without extra passes.  I still gotta look into
that halo thingy for the outer edges though.  Or maybe I'm still
missing something in my understanding of the blend fns.  It seems
like there oughta be some way to blend that insures the destination
alpha value never decreases.  Then the polys drawn first would
bump the alpha values to 1.0 everywhere but at the extreme outer
antialiased edges.

Don



Message has 1 Reply:
  Re: LDGlite and LPub (and maybe ldview?
 
(...) Ahh, nevermind. That didn't really work either. Applying the opaque/transparent only filter right before dumping the png is simple, and looks good enough for me. I'm going with that and forget about the icky sharp outer edges for now. They (...) (20 years ago, 15-Oct-04, to lugnet.cad.dev)

Message is in Reply To:
  Re: LDGlite and LPub (and maybe ldview?
 
(...) Thanks, that did it. Yuck! (...) Let's see if I understand what's going on here. When I antialias the edge lines, the RGB colors buffer gets blended, and so does the alpha channel. If alpha was all zeros, now instead of all ones, it gets (...) (20 years ago, 15-Oct-04, to lugnet.cad.dev)

52 Messages in This Thread:













Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR