2023-04-22 13:10:28 +00:00
|
|
|
[gd_scene load_steps=12 format=3 uid="uid://bdnesuqroi7ss"]
|
2023-03-27 17:18:48 +00:00
|
|
|
|
2023-04-22 13:10:28 +00:00
|
|
|
[ext_resource type="Shader" path="res://vfx/particle_mixer.gdshader" id="1_i6oe2"]
|
|
|
|
|
[ext_resource type="Texture2D" uid="uid://dq7jm5ufknbb6" path="res://vfx/lens-flare-particle.png" id="2_h5y3k"]
|
2023-03-27 17:18:48 +00:00
|
|
|
|
2023-04-22 13:10:28 +00:00
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lpenh"]
|
|
|
|
|
render_priority = 0
|
|
|
|
|
shader = ExtResource("1_i6oe2")
|
|
|
|
|
shader_parameter/particle_color = null
|
|
|
|
|
shader_parameter/particle_texture = ExtResource("2_h5y3k")
|
|
|
|
|
|
|
|
|
|
[sub_resource type="Gradient" id="Gradient_tjuvm"]
|
|
|
|
|
offsets = PackedFloat32Array(0, 0.50813, 1)
|
|
|
|
|
colors = PackedColorArray(1, 0.877403, 0.516545, 1, 0.94702, 0.505309, 0.59484, 1, 0.735853, 0.324231, 0.687053, 1)
|
|
|
|
|
|
|
|
|
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_d2t20"]
|
|
|
|
|
gradient = SubResource("Gradient_tjuvm")
|
|
|
|
|
|
|
|
|
|
[sub_resource type="Gradient" id="Gradient_c8r4y"]
|
|
|
|
|
offsets = PackedFloat32Array(0, 0.00813008, 0.52439, 1)
|
|
|
|
|
colors = PackedColorArray(0, 0, 0, 1, 0.0284553, 0.0284553, 0.0284553, 1, 0.244776, 0.244776, 0.244776, 1, 0, 0, 0, 1)
|
|
|
|
|
|
|
|
|
|
[sub_resource type="GradientTexture1D" id="GradientTexture1D_2vogp"]
|
|
|
|
|
gradient = SubResource("Gradient_c8r4y")
|
|
|
|
|
|
|
|
|
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_eegys"]
|
2023-03-27 17:18:48 +00:00
|
|
|
emission_shape = 1
|
2023-07-13 14:11:44 +00:00
|
|
|
emission_sphere_radius = 0.2
|
2023-03-27 17:18:48 +00:00
|
|
|
spread = 180.0
|
2023-04-22 13:10:28 +00:00
|
|
|
initial_velocity_max = 0.2
|
2023-12-02 13:27:18 +00:00
|
|
|
gravity = Vector3(0, 0.02, 0)
|
2023-04-22 13:10:28 +00:00
|
|
|
color_ramp = SubResource("GradientTexture1D_2vogp")
|
|
|
|
|
color_initial_ramp = SubResource("GradientTexture1D_d2t20")
|
2023-03-27 17:18:48 +00:00
|
|
|
turbulence_enabled = true
|
2023-04-22 13:10:28 +00:00
|
|
|
turbulence_noise_strength = 0.1
|
|
|
|
|
turbulence_noise_scale = 2.0
|
2023-03-27 17:18:48 +00:00
|
|
|
turbulence_noise_speed = Vector3(0.1, 0.3, 0.5)
|
|
|
|
|
turbulence_noise_speed_random = 0.3
|
2023-04-22 13:10:28 +00:00
|
|
|
turbulence_influence_min = 0.01
|
2023-07-13 14:11:44 +00:00
|
|
|
turbulence_influence_max = 0.02
|
2023-03-27 17:18:48 +00:00
|
|
|
turbulence_initial_displacement_max = 1.0
|
|
|
|
|
|
2023-04-22 13:10:28 +00:00
|
|
|
[sub_resource type="Shader" id="Shader_p2314"]
|
|
|
|
|
code = "// NOTE: Shader automatically converted from Godot Engine 4.0.stable's StandardMaterial3D.
|
|
|
|
|
|
|
|
|
|
shader_type spatial;
|
|
|
|
|
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_disabled;
|
|
|
|
|
uniform vec4 albedo : source_color;
|
|
|
|
|
uniform sampler2D texture_albedo : source_color,filter_linear_mipmap,repeat_enable;
|
|
|
|
|
uniform float point_size : hint_range(0,128);
|
|
|
|
|
uniform float roughness : hint_range(0,1);
|
|
|
|
|
uniform sampler2D texture_metallic : hint_default_white,filter_linear_mipmap,repeat_enable;
|
|
|
|
|
uniform vec4 metallic_texture_channel;
|
|
|
|
|
uniform sampler2D texture_roughness : hint_roughness_r,filter_linear_mipmap,repeat_enable;
|
|
|
|
|
uniform float specular;
|
|
|
|
|
uniform float metallic;
|
|
|
|
|
uniform int particles_anim_h_frames;
|
|
|
|
|
uniform int particles_anim_v_frames;
|
|
|
|
|
uniform bool particles_anim_loop;
|
|
|
|
|
uniform vec4 backlight : source_color;
|
|
|
|
|
uniform sampler2D texture_backlight : hint_default_black,filter_linear_mipmap,repeat_enable;
|
|
|
|
|
uniform vec3 uv1_scale;
|
|
|
|
|
uniform vec3 uv1_offset;
|
|
|
|
|
uniform vec3 uv2_scale;
|
|
|
|
|
uniform vec3 uv2_offset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void vertex() {
|
|
|
|
|
UV=UV*uv1_scale.xy+uv1_offset.xy;
|
|
|
|
|
mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);
|
|
|
|
|
mat_world = mat_world * mat4(vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));
|
|
|
|
|
MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;
|
|
|
|
|
MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
|
|
|
|
|
float h_frames = float(particles_anim_h_frames);
|
|
|
|
|
float v_frames = float(particles_anim_v_frames);
|
|
|
|
|
float particle_total_frames = float(particles_anim_h_frames * particles_anim_v_frames);
|
|
|
|
|
float particle_frame = floor(INSTANCE_CUSTOM.z * float(particle_total_frames));
|
|
|
|
|
if (!particles_anim_loop) {
|
|
|
|
|
particle_frame = clamp(particle_frame, 0.0, particle_total_frames - 1.0);
|
|
|
|
|
} else {
|
|
|
|
|
particle_frame = mod(particle_frame, particle_total_frames);
|
|
|
|
|
}
|
|
|
|
|
UV /= vec2(h_frames, v_frames);
|
|
|
|
|
UV += vec2(mod(particle_frame, h_frames) / h_frames, floor((particle_frame + 0.5) / h_frames) / v_frames);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void fragment() {
|
|
|
|
|
vec2 base_uv = UV;
|
|
|
|
|
vec4 albedo_tex = texture(texture_albedo,base_uv);
|
|
|
|
|
albedo_tex *= COLOR;
|
|
|
|
|
ALBEDO = albedo.rgb * albedo_tex.rgb;
|
|
|
|
|
float metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);
|
|
|
|
|
METALLIC = metallic_tex * metallic;
|
|
|
|
|
vec4 roughness_texture_channel = vec4(1.0,0.0,0.0,0.0);
|
|
|
|
|
float roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);
|
|
|
|
|
ROUGHNESS = roughness_tex * roughness;
|
|
|
|
|
SPECULAR = specular;
|
|
|
|
|
vec3 backlight_tex = texture(texture_backlight,base_uv).rgb;
|
|
|
|
|
BACKLIGHT = (backlight.rgb+backlight_tex);
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
|
|
|
|
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fgrmi"]
|
|
|
|
|
render_priority = 0
|
|
|
|
|
shader = SubResource("Shader_p2314")
|
|
|
|
|
shader_parameter/albedo = Color(1, 1, 1, 1)
|
|
|
|
|
shader_parameter/point_size = 1.0
|
|
|
|
|
shader_parameter/roughness = 1.0
|
2023-08-21 06:40:25 +00:00
|
|
|
shader_parameter/metallic_texture_channel = null
|
2023-04-22 13:10:28 +00:00
|
|
|
shader_parameter/specular = 0.5
|
|
|
|
|
shader_parameter/metallic = 0.0
|
|
|
|
|
shader_parameter/particles_anim_h_frames = 1
|
|
|
|
|
shader_parameter/particles_anim_v_frames = 1
|
|
|
|
|
shader_parameter/particles_anim_loop = false
|
|
|
|
|
shader_parameter/backlight = Color(0, 0, 0, 1)
|
|
|
|
|
shader_parameter/uv1_scale = Vector3(1, 1, 1)
|
|
|
|
|
shader_parameter/uv1_offset = Vector3(0, 0, 0)
|
|
|
|
|
shader_parameter/uv2_scale = Vector3(1, 1, 1)
|
|
|
|
|
shader_parameter/uv2_offset = Vector3(0, 0, 0)
|
|
|
|
|
shader_parameter/texture_albedo = ExtResource("2_h5y3k")
|
|
|
|
|
shader_parameter/texture_backlight = ExtResource("2_h5y3k")
|
|
|
|
|
|
2023-03-27 17:18:48 +00:00
|
|
|
[sub_resource type="QuadMesh" id="QuadMesh_ea2fp"]
|
2023-04-22 13:10:28 +00:00
|
|
|
material = SubResource("ShaderMaterial_fgrmi")
|
2023-07-13 14:11:44 +00:00
|
|
|
size = Vector2(0.06, 0.06)
|
2023-03-27 17:18:48 +00:00
|
|
|
|
|
|
|
|
[node name="collectable_particles" type="GPUParticles3D"]
|
2023-04-22 13:10:28 +00:00
|
|
|
material_override = SubResource("ShaderMaterial_lpenh")
|
|
|
|
|
cast_shadow = 0
|
|
|
|
|
amount = 50
|
2023-03-27 17:18:48 +00:00
|
|
|
lifetime = 10.0
|
2023-07-13 14:11:44 +00:00
|
|
|
speed_scale = 0.5
|
2023-04-22 13:10:28 +00:00
|
|
|
process_material = SubResource("ParticleProcessMaterial_eegys")
|
2023-03-27 17:18:48 +00:00
|
|
|
draw_pass_1 = SubResource("QuadMesh_ea2fp")
|