Skip to content

Commit

Permalink
Merge pull request #6346 from AnalyticalGraphicsInc/alpha-mask-default
Browse files Browse the repository at this point in the history
Fix default value of alphaCutoff.
  • Loading branch information
lilleyse authored Mar 19, 2018
2 parents 790ffd0 + 7f77d2f commit f773f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Change Log
* Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302)
* Fixed improper zoom during model load failure. [#6305](https://github.com/AnalyticalGraphicsInc/cesium/pull/6305)
* Fixed model loading failure when containing unused materials. [6315](https://github.com/AnalyticalGraphicsInc/cesium/pull/6315)
* Fixed default value of `alphaCutoff` in glTF models. [#6346](https://github.com/AnalyticalGraphicsInc/cesium/pull/6346)

### 1.43 - 2018-03-01

Expand Down
8 changes: 2 additions & 6 deletions Source/ThirdParty/GltfPipeline/processPbrMetallicRoughness.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,8 @@ define([
var alphaMode = material.alphaMode;
if (defined(alphaMode)) {
if (alphaMode === 'MASK') {
var alphaCutoff = material.alphaCutoff;
if (defined(alphaCutoff)) {
fragmentShader += ' gl_FragColor = vec4(color, int(baseColorWithAlpha.a >= ' + alphaCutoff + '));\n';
} else {
fragmentShader += ' gl_FragColor = vec4(color, 1.0);\n';
}
var alphaCutoff = defaultValue(material.alphaCutoff, 0.5);
fragmentShader += ' gl_FragColor = vec4(color, int(baseColorWithAlpha.a >= ' + alphaCutoff + '));\n';
} else if (alphaMode === 'BLEND') {
fragmentShader += ' gl_FragColor = vec4(color, baseColorWithAlpha.a);\n';
} else {
Expand Down

0 comments on commit f773f67

Please sign in to comment.