[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Weird alpha issue.




----- Original Message -----
> gl = canvas.getContext ( "experimental-webgl", { antialias:
> true, stencil: false, alpha: false }
> 
> * In Minefield, this change makes no difference under either Linux or
> Windows - so evidently it ignores the "alpha: false" property and
> hands me a destination alpha anyway.

Yep, this is bug 539771, which unfortunately is waiting on a fix to some low-level code before it can land.

> 4) In both browsers and all OS's, the outer edges of the smoke puff
> textured quads are alpha=0 - and they seem to have been 'discarded'
> (they didn't write a zero alpha to the destination alpha because then
> there would be square holes instead of smoke-puff-shaped holes) - which
> suggests that the glAlphaTest is enabled...but I was under the
> impression that this wasn't implemented in WebGL. Failing to render
> alpha=0 pixels is a huge "no-no" if people genuinely did want
> destination alpha!

Interesting -- can you post your testcase?  I'd like to tweak a few things
and be able to see the changes :-)

Thanks,
    - Vlad

> On 10/31/2010 12:14 PM, Steve Baker wrote:
> > Holy crap! I didn't expect *THAT*!
> >
> > So - I make a super-simple "test-app" version of my game (in another
> > directory) and it produces white smoke where the main app generates
> > dark. Next, I start to make my test application more and more like
> > the
> > real application and the smoke stubbornly stays white (ie it looks
> > the
> > same in Chrome as it does in Minefield).
> >
> > Eventually, I have PRECISELY the same lines of code in the test-app
> > and
> > the real-app - the same textures, the same shaders, the same
> > absolutely
> > everything. And they still look different!! I have NO clue WTF is
> > making these two apps different.
> >
> > Er...except for the HTML that hosts the web page has:
> >
> >    <body bgcolor="#000000"> in the 'real application'
> >    <body> in the 'test
> > application'
> >
> > And lo and behold - when I change the HTML background color, the
> > color
> > of the smoke changes! So it looks like the problem is in the
> > compositing step.
> >
> > I kinda suspect that I'm somehow getting a "destination alpha" frame
> > buffer in Minefield and no "destination alpha" in Chrome - so when I
> > write my translucent polygons into the frame buffer, I'm making the
> > resulting canvas have translucent bits! Maybe that makes the
> > compositor blend in the HTML page's background wherever I write my
> > particles?
> >
> > I'm doing more experiments. I tried taking the SDK demo program
> > "sdk/demos/google/particles" and changing the HTML background to
> > black -
> > but that didn't make a difference...so it's obviously a little more
> > complicated than just that.
> >
> > Man - it's been about a decade since I last messed with destination
> > alpha! I'm going to have to dust off my ancient copy of the "Red
> > Book"
> > and try to kick my memory into life!
> >
> >   -- Steve
> >
> > -----------------------------------------------------------
> > You are currently subscribed to public_webgl@khronos.org.
> > To unsubscribe, send an email to majordomo@khronos.org with
> > the following command in the body of your email:
> >
> >
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: