Skip to content

Commit

Permalink
Merge pull request #355 from emackey/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 9c4976c + 98a2095 commit 23f0082
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/processPbrMetallicRoughness.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,8 @@ function generateTechnique(gltf, material, options) {
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 23f0082

Please sign in to comment.