Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type particles;
- render_mode keep_data;
- uniform bool fadeCont;
- uniform float fadeStep : hint_range(0.0, 10.0);
- uniform float red : hint_range(0.0, 1.0);
- uniform float green : hint_range(0.0, 1.0);
- uniform float blue : hint_range(0.0, 1.0);
- uniform float tex_anim_offset;
- void start() {
- // Called when a particle is spawned.
- }
- void process() {
- // Called every frame on existing particles (according to the Fixed FPS property).
- CUSTOM.y += DELTA / LIFETIME;
- CUSTOM.w = 1.0;
- float tv = CUSTOM.y / CUSTOM.w;
- COLOR.rgb = vec3(COLOR.r * red, COLOR.g * green, COLOR.b * blue) * 10.0;
- if (fadeCont) {
- COLOR.a = 1.0 - tv;
- } else {
- COLOR.a = floor((1.0 - tv) * fadeStep) / fadeStep;
- }
- if (RESTART) {
- CUSTOM.z = tex_anim_offset;
- CUSTOM.y = 0.0;
- COLOR = vec4(1.0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment