Possible issue with default blendFuncSeparate values

I’ve been messing around with trying to get my models that have transparency in the texture to show up without the whole model being transparent. I narrowed it down to the default values of blendFuncSeparate in COLLADA2GLTF and gltf-pipeline. The default values for premultipliedAlpha is

blendFuncSeparate : [

WebGLConstants.ONE,

WebGLConstants.ONE_MINUS_SRC_ALPHA,

WebGLConstants.ONE,

WebGLConstants.ONE_MINUS_SRC_ALPHA

]

``

Cesium loads it like this:
functionSourceRgb : blendFuncSeparate[0],

functionSourceAlpha : blendFuncSeparate[1],

functionDestinationRgb : blendFuncSeparate[2],

functionDestinationAlpha : blendFuncSeparate[3]

``

Cesium is loading as per the gltf spec.

Model looks like this with the default values:

Correct me if I’m wrong, but seems like the default should be:

blendFuncSeparate : [

WebGLConstants.ONE,

WebGLConstants.ONE,

WebGLConstants.ONE_MINUS_SRC_ALPHA,

WebGLConstants.ONE_MINUS_SRC_ALPHA

]

After changing my gltf to use

“blendFuncSeparate”: [

1,

1,

771,

771

],

``

the model appeared correct.

Hi Jason,

First of all - this explains so much! Thanks for finding this! I’ve been bothered by this for a while since this bug only seems to affect those of us who don’t support OIT.

However I believe the converters are actually correct and Cesium is wrong - and there is a typo in the glTF spec. The glTF function is modeled after glBlendFuncSeparate and is stated correctly in one part of the glTF spec, but stated incorrectly here. I’m going to open PRs for both repos.