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

Re: [Public WebGL] WebGL spec modifications for D3D



On Apr 22, 2010, at 12:18 PM, Vangelis Kokkevis wrote:

> 
> ...4. Conflicting constant color usage. In D3D we can't directly support alpha blending for the cases where the source blend function is set to GL_CONSTANT_ALPHA (or GL_ONE_MINUS_CONSTANT_ALPHA), and the destination blend function is set to GL_CONSTANT_COLOR, or vice versa. That's because GL_CONSTANT_ALPHA has no D3D9 equivalent and if we replicate the alpha to the RGB components we can no longer use the RGB components for the other blend function.  Spec change: 
>   a) completely remove support for GL_CONSTANT_ALPHA and ONE_MINUS_CONSTANT_ALPHA (ie return GL_INVALID_VALUE), -or-
>   b) glBlendFunc/Separate sets GL_INVALID_OPERATION if a source function is GL_CONSTANT_ALPHA or GL_ONE_MINUS_CONSTANT_ALPHA and the corresponding destination function is GL_CONSTANT_COLOR or or GL_ONE_MINUS_CONSTANT_COLOR, or vice versa.

I haven't thought about this one enough, but it makes me a little concerned. If I want to fade out an object by turning constant alpha down to 0, I can't do that? I suppose I can do the same thing by passing an alpha value to the shader. But couldn't there be alpha blending optimizations we could be missing by doing that? Like I said, I haven't thought about this enough, so maybe these concerns are nothing to worry about.

-----
~Chris
cmarrin@apple.com




-----------------------------------------------------------
You are currently subscribe to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: