本文主要是介绍Shader特效:流光效果,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
使用一个渐变图来引导流光的走向
shader_type canvas_item;
uniform sampler2D light_vector;
uniform float width = 0.08;void fragment(){vec4 color = texture(TEXTURE,UV);if(color.a != 0.0){float v = texture(light_vector,UV).r;float diff = v - cos(TIME*0.5);if(abs(diff) < width){color = vec4(0.3,0.3,0.0,0.3)*(1.0 - abs(diff)/width) + color;}}COLOR = color;
}
这篇关于Shader特效:流光效果的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!