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

Re: [Public WebGL] FF generating: WebGL: bendFunc: dfactor: invaldi enum value 0x201




I think you're getting confused!

GL_LESS isn't ever valid as the second parameter of glBlendFunc in any
version of OpenGL/OpenGL-ES/WebGL (or Direct3D for that matter!).

The two parameters specify what happens to the source and destination
colours, so you might have:

   glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA )

...or in WebGL:

   gl.blendFunc ( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA ) ;

GL_LESS is a parameter of glAlphaFunc - which controls how the
alpha-test feature operates.  Alpha test is absent in OpenGL-ES-2.x (and
hence WebGL) because it's just as easy to do it in your shader by saying
something like:

    if ( alpha < whatever ) discard ;

The token GL_LESS is still defined because it's used in glDepthFunc -
which is supported in OpenGL-ES.

 -- Steve


On 03/10/2011 08:34 PM, Stephen Bannasch wrote:
>
> When I set webgl.berbose to true in FF/Minefield I'm getting this error:
>
>   WebGL: bendFunc: dfactor: invaldi enum value 0x201
>
> when executing:
>
>   gl.blendFunc(gl.ONE_MINUS_SRC_ALPHA, gl.LESS)
>
> You can see this happen on this page:
>
>   http://scenejs.org/dist/curr/extr/examples/hello-teapot/index.html
>
> The spec states LESS is not supported:
>
>  
> http://www.khronos.org/registry/webgl/specs/latest/#CONSTANT_COLOR_BLEND
>
>   /* AlphaFunction (not supported in ES20) */
>   /*      NEVER */
>   /*      LESS */
>   /*      EQUAL */
>   /*      LEQUAL */
>   /*      GREATER */
>   /*      NOTEQUAL */
>   /*      GEQUAL */
>   /*      ALWAYS */
>
>   /* BlendingFactorDest */
>   const GLenum ZERO                           = 0;
>   const GLenum ONE                            = 1;
>   const GLenum SRC_COLOR                      = 0x0300;
>   const GLenum ONE_MINUS_SRC_COLOR            = 0x0301;
>   const GLenum SRC_ALPHA                      = 0x0302;
>   const GLenum ONE_MINUS_SRC_ALPHA            = 0x0303;
>   const GLenum DST_ALPHA                      = 0x0304;
>   const GLenum ONE_MINUS_DST_ALPHA            = 0x0305;
>
> Is this operation supported?
>
> I don't see a way to turn on something equivalent to webgl.verbose in
> Safari/WebKit or Chrome but I haven't seen those errors/warnings
> running in these browsers.
>
>
> -----------------------------------------------------------
> 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:
> unsubscribe public_webgl
> -----------------------------------------------------------
>

-----------------------------------------------------------
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:
unsubscribe public_webgl
-----------------------------------------------------------