浏览代码

FXAA.frag: read alpha value from texture instead of passing constant 1. (#1517)

Ali-RS 4 年之前
父节点
当前提交
90a35047ef
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      jme3-effects/src/main/resources/Common/MatDefs/Post/FXAA.frag

+ 2 - 2
jme3-effects/src/main/resources/Common/MatDefs/Post/FXAA.frag

@@ -84,6 +84,6 @@ vec3 FxaaPixelShader(
 
 void main()
 {
-
-    gl_FragColor = vec4(FxaaPixelShader(posPos, m_Texture, g_ResolutionInverse), 1.0);
+    vec4 texVal = texture2D(m_Texture, texCoord);
+    gl_FragColor = vec4(FxaaPixelShader(posPos, m_Texture, g_ResolutionInverse), texVal.a);
 }