瀏覽代碼

Batching - fix custom MODULATE shader applying modulate twice

One of the new fvf types (FVF_MODULATED) allows batching custom shaders that use modulate. The only slight oversight is that there is a special define when MODULATE is used in a custom shader, called MODULATE_USED, that is checked, and if set it does NOT apply final_modulate as part of canvas.glsl.

This MODULATE_USED define wasn't checked when the new FVF was used and modulate was passed in an attribute.

This PR moves the application of the final_modulate into the #ifndef MODULATE_USED section.
lawnjelly 4 年之前
父節點
當前提交
c401960634
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gles2/shaders/canvas.glsl

+ 1 - 1
drivers/gles2/shaders/canvas.glsl

@@ -480,10 +480,10 @@ FRAGMENT_SHADER_CODE
 #endif
 	}
 
+#if !defined(MODULATE_USED)
 #ifdef USE_ATTRIB_MODULATE
 	color *= modulate_interp;
 #else
-#if !defined(MODULATE_USED)
 	color *= final_modulate;
 #endif
 #endif