|
@@ -8496,7 +8496,6 @@ class Material extends EventDispatcher {
|
|
|
this.shadowSide = null;
|
|
|
|
|
|
this.colorWrite = true;
|
|
|
- this.alphaWrite = true;
|
|
|
|
|
|
this.precision = null; // override the renderer's default precision for this material
|
|
|
|
|
@@ -8755,7 +8754,6 @@ class Material extends EventDispatcher {
|
|
|
data.depthTest = this.depthTest;
|
|
|
data.depthWrite = this.depthWrite;
|
|
|
data.colorWrite = this.colorWrite;
|
|
|
- data.alphaWrite = this.alphaWrite;
|
|
|
|
|
|
data.stencilWrite = this.stencilWrite;
|
|
|
data.stencilWriteMask = this.stencilWriteMask;
|
|
@@ -8891,7 +8889,6 @@ class Material extends EventDispatcher {
|
|
|
this.shadowSide = source.shadowSide;
|
|
|
|
|
|
this.colorWrite = source.colorWrite;
|
|
|
- this.alphaWrite = source.alphaWrite;
|
|
|
|
|
|
this.precision = source.precision;
|
|
|
|
|
@@ -12984,7 +12981,7 @@ const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity
|
|
|
|
|
|
const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
|
|
|
|
|
|
-const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}";
|
|
|
+const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";
|
|
|
|
|
|
const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
|
|
|
|
|
@@ -18546,7 +18543,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
|
|
|
( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',
|
|
|
|
|
|
parameters.dithering ? '#define DITHERING' : '',
|
|
|
- parameters.alphaWrite ? '' : '#define OPAQUE',
|
|
|
+ parameters.transparent ? '' : '#define OPAQUE',
|
|
|
|
|
|
ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
|
|
|
getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ),
|
|
@@ -19047,9 +19044,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
specularIntensityMap: !! material.specularIntensityMap,
|
|
|
specularColorMap: !! material.specularColorMap,
|
|
|
|
|
|
+ transparent: material.transparent,
|
|
|
+
|
|
|
alphaMap: !! material.alphaMap,
|
|
|
alphaTest: useAlphaTest,
|
|
|
- alphaWrite: material.alphaWrite || material.transparent,
|
|
|
|
|
|
gradientMap: !! material.gradientMap,
|
|
|
|
|
@@ -19196,7 +19194,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
array.push( parameters.toneMapping );
|
|
|
array.push( parameters.numClippingPlanes );
|
|
|
array.push( parameters.numClipIntersection );
|
|
|
- array.push( parameters.alphaWrite );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -19318,6 +19315,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
|
|
|
_programLayers.enable( 21 );
|
|
|
if ( parameters.decodeVideoTexture )
|
|
|
_programLayers.enable( 22 );
|
|
|
+ if ( parameters.transparent )
|
|
|
+ _programLayers.enable( 23 );
|
|
|
|
|
|
array.push( _programLayers.mask );
|
|
|
|
|
@@ -40879,7 +40878,6 @@ class MaterialLoader extends Loader {
|
|
|
if ( json.depthTest !== undefined ) material.depthTest = json.depthTest;
|
|
|
if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;
|
|
|
if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;
|
|
|
- if ( json.alphaWrite !== undefined ) material.alphaWrite = json.alphaWrite;
|
|
|
|
|
|
if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;
|
|
|
if ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;
|