|
@@ -402,6 +402,7 @@ function buildMaterial( material, textures ) {
|
|
|
float outputs:g
|
|
|
float outputs:b
|
|
|
float3 outputs:rgb
|
|
|
+ ${ material.transparent || material.alphaTest > 0.0 ? 'float outputs:a' : '' }
|
|
|
}`;
|
|
|
|
|
|
}
|
|
@@ -410,6 +411,17 @@ function buildMaterial( material, textures ) {
|
|
|
|
|
|
inputs.push( `${ pad }color3f inputs:diffuseColor.connect = </Materials/Material_${ material.id }/Texture_${ material.map.id }_diffuse.outputs:rgb>` );
|
|
|
|
|
|
+ if ( material.transparent ) {
|
|
|
+
|
|
|
+ inputs.push( `${ pad }float inputs:opacity.connect = </Materials/Material_${ material.id }/Texture_${ material.map.id }_diffuse.outputs:a>` );
|
|
|
+
|
|
|
+ } else if ( material.alphaTest > 0.0 ) {
|
|
|
+
|
|
|
+ inputs.push( `${ pad }float inputs:opacity.connect = </Materials/Material_${ material.id }/Texture_${ material.map.id }_diffuse.outputs:a>` );
|
|
|
+ inputs.push( `${ pad }float inputs:opacityThreshold = ${material.alphaTest}` );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
samplers.push( buildTexture( material.map, 'diffuse', material.color ) );
|
|
|
|
|
|
} else {
|