Przeglądaj źródła

Fixed alpha_to_coverage bug (#22135)

WestLangley 4 lat temu
rodzic
commit
8c81b6163c
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      examples/jsm/lines/LineMaterial.js

+ 3 - 3
examples/jsm/lines/LineMaterial.js

@@ -218,7 +218,7 @@ ShaderLib[ 'line' ] = {
 
 			#endif
 
-			float alpha = opacity;
+			float alpha = 1.0;
 
 			#ifdef ALPHA_TO_COVERAGE
 
@@ -248,12 +248,12 @@ ShaderLib[ 'line' ] = {
 
 			#endif
 
-			vec4 diffuseColor = vec4( diffuse, alpha );
+			vec4 diffuseColor = vec4( diffuse, opacity * alpha );
 
 			#include <logdepthbuf_fragment>
 			#include <color_fragment>
 
-			gl_FragColor = vec4( diffuseColor.rgb, alpha );
+			gl_FragColor = diffuseColor;
 
 			#include <tonemapping_fragment>
 			#include <encodings_fragment>