浏览代码

Fixed alpha_to_coverage bug (#22135)

WestLangley 4 年之前
父节点
当前提交
8c81b6163c
共有 1 个文件被更改,包括 3 次插入3 次删除
  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>