-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnode_3d.tscn
More file actions
193 lines (161 loc) · 7.1 KB
/
node_3d.tscn
File metadata and controls
193 lines (161 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[gd_scene load_steps=13 format=3 uid="uid://bwv73s117kxfr"]
[ext_resource type="Script" uid="uid://c2ja1eugyxfeq" path="res://addons/UniParticles3D/UniParticles3D.gd" id="1_noarx"]
[ext_resource type="Texture2D" uid="uid://cngwyurxcqj51" path="res://icon.svg" id="4_jka67"]
[sub_resource type="Curve" id="Curve_r3fl7"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.344595, 1), 0.0, 0.0, 0, 0, Vector2(0.831081, 0.237758), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="Curve" id="Curve_i5arm"]
_data = [Vector2(0, 0.0492913), 0.0, 0.0, 0, 0, Vector2(0.751689, 0.63982), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Gradient" id="Gradient_noarx"]
offsets = PackedFloat32Array(0, 0.305556, 0.5573, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0.556863, 1, 1, 1, 0.189953, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_a0tk4"]
gradient = SubResource("Gradient_noarx")
[sub_resource type="Curve" id="Curve_jka67"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Shader" id="Shader_noarx"]
code = "// NOTE: Shader automatically converted from Godot Engine 4.4.beta's StandardMaterial3D.
shader_type spatial;
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx;
uniform vec4 albedo : source_color;
uniform sampler2D texture_albedo : source_color, filter_linear_mipmap, repeat_enable;
uniform ivec2 albedo_texture_size;
uniform float point_size : hint_range(0.1, 128.0, 0.1);
uniform float roughness : hint_range(0.0, 1.0);
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 : hint_range(0.0, 1.0, 0.01);
uniform float metallic : hint_range(0.0, 1.0, 0.01);
uniform int particles_anim_h_frames : hint_range(1, 128);
uniform int particles_anim_v_frames : hint_range(1, 128);
uniform bool particles_anim_loop;
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;
// Billboard Mode: Particles
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 = albedo.rgb * albedo_tex.rgb;
float metallic_tex = dot(texture(texture_metallic, base_uv), metallic_texture_channel);
METALLIC = metallic_tex * metallic;
SPECULAR = specular;
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;
}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_a0tk4"]
render_priority = 0
shader = SubResource("Shader_noarx")
shader_parameter/albedo = Color(1, 1, 1, 1)
shader_parameter/albedo_texture_size = Vector2i(0, 0)
shader_parameter/point_size = 1.0
shader_parameter/roughness = 1.0
shader_parameter/metallic_texture_channel = Vector4(1, 0, 0, 0)
shader_parameter/specular = 0.5
shader_parameter/metallic = 0.0
shader_parameter/particles_anim_h_frames = 2
shader_parameter/particles_anim_v_frames = 2
shader_parameter/particles_anim_loop = true
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)
[sub_resource type="QuadMesh" id="QuadMesh_r3fl7"]
material = SubResource("ShaderMaterial_a0tk4")
[sub_resource type="CylinderShape3D" id="CylinderShape3D_a0tk4"]
[sub_resource type="Curve" id="Curve_wc5p8"]
_limits = [0.0, 5.0, 0.0, 1.0]
_data = [Vector2(0, 0), 0.0, 5.0, 0, 1, Vector2(1, 5), 5.0, 0.0, 1, 0]
point_count = 2
[node name="Node3D" type="Node3D"]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.984689, 0.174318, 0, -0.174318, 0.984689, 0, 0.690435, 2.31462)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.75025, -0.470954, 0.464035, 0, 0.701855, 0.71232, -0.661155, -0.534418, 0.526566, 2.06632, -1.19209e-07, 0.815283)
[node name="UniParticles3D" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.999999, 0, 0, 0, 1, 0.304082, 0.453068, 0.195462)
script = ExtResource("1_noarx")
duration = 3.0
start_lifetime_random = Vector2(0.2, 2)
start_speed_constant = 2.0
start_speed_random = Vector2(0.1, 0.2)
gravity = Vector3(0, -20, 0)
start_size_random = Vector4(0.1, 0.1, 0.4, 0.4)
start_rotation_degrees_constant = 180.0
use_world_space = true
enable_play_behavior = Vector2i(1, 0)
max_particles = 500
rate_over_time = 20.0
rate_over_distance = 5.0
enable_shape = Vector2i(1, 0)
radius = 0.58
radius_thickness = 0.234
angle = 25.5
arc_spread = 1.0
enable_size_over_lifetime = Vector2i(1, 0)
size_over_lifetime = SubResource("Curve_r3fl7")
enable_rotation_over_lifetime = Vector2i(1, 0)
orbit_over_lifetime = SubResource("Curve_i5arm")
enable_color_over_lifetime = Vector2i(1, 1)
color_over_lifetime = SubResource("GradientTexture1D_a0tk4")
hue_variation = 0.695
h_frames = 2
v_frames = 2
frame_over_time = SubResource("Curve_jka67")
enable_rendering = Vector2i(1, 1)
particle_texture = ExtResource("4_jka67")
align_to_velocity = true
metadata/_custom_type_script = "uid://c2ja1eugyxfeq"
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
visible = false
mesh = SubResource("QuadMesh_r3fl7")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
visible = false
shape = SubResource("CylinderShape3D_a0tk4")
[node name="UniParticles3D2" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.36538, -0.930858, 0, 0.930858, 0.36538, 0, 0, 0)
script = ExtResource("1_noarx")
start_lifetime_constant = 3.0
start_speed_constant = 1.0
enable_play_behavior = Vector2i(1, 0)
enable_emission = Vector2i(1, 1)
rate_over_time = 4.0
rate_over_distance = 0.0
enable_rotation_over_lifetime = Vector2i(1, 1)
rotation_over_lifetime = SubResource("Curve_wc5p8")
enable_rendering = Vector2i(1, 1)
particle_texture = ExtResource("4_jka67")
billboard_mode = 1
metadata/_custom_type_script = "uid://c2ja1eugyxfeq"