瀏覽代碼

GradientMapLife.hx working on both horizontal and vertical gradients.

clementlandrin 2 月之前
父節點
當前提交
d89f51737d
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      hrt/shader/GradientMapLife.hx

+ 1 - 3
hrt/shader/GradientMapLife.hx

@@ -12,11 +12,9 @@ class GradientMapLife extends hxsl.Shader {
 		@param var gradient : Sampler2D;
 		@param var gradient : Sampler2D;
 
 
 		function fragment() {
 		function fragment() {
-			var t = sourceAlpha ? pixelColor.a : dot(pixelColor.rgb*pixelColor.rgb, vec3(0.2126, 0.7152, 0.0722));
-
 			// force texture reapeat
 			// force texture reapeat
 			var s = gradient.size();
 			var s = gradient.size();
-			var sample = gradient.get(vec2(saturate(t), saturate(particleLife/particleLifeTime)) * (s-vec2(1.0))/(s));
+			var sample = gradient.get(vec2(saturate(particleLife/particleLifeTime)) * (s-vec2(1.0))/(s));
 			if (colorMult) {
 			if (colorMult) {
 				pixelColor.rgb *= sample.rgb;
 				pixelColor.rgb *= sample.rgb;
 			}
 			}