Converted most of the SpatialMaterials to ShaderMaterial.

This commit is contained in:
Relintai 2019-12-03 16:33:46 +01:00
parent ca8bdf9ce2
commit b58f5093da
10 changed files with 94 additions and 92 deletions

View File

@ -0,0 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=2]
[ext_resource path="res://data/shaders/2_simple_particle_billboard_shader.shader" type="Shader" id=1]
[resource]
shader = ExtResource( 1 )
shader_param/albedo = Color( 1, 1, 1, 1 )

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
shader_type spatial;
render_mode blend_add,depth_draw_opaque,cull_disabled,specular_disabled,unshaded;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
void vertex() {
mat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_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 = INV_CAMERA_MATRIX * mat_world;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
ALPHA = albedo.a * albedo_tex.a;
}

View File

@ -0,0 +1,11 @@
shader_type spatial;
render_mode blend_add,depth_draw_opaque,cull_disabled,specular_disabled,unshaded;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
ALBEDO = albedo.rgb * albedo_tex.rgb;
ALPHA = albedo.a * albedo_tex.a;
}

View File

@ -1,14 +1,18 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[sub_resource type="SpatialMaterial" id=1] [ext_resource path="res://data/shaders/1_standard_shader.tres" type="Shader" id=1]
albedo_color = Color( 0.635294, 0.462745, 0.239216, 1 )
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/albedo = Color( 0.635294, 0.462745, 0.239216, 1 )
[sub_resource type="CubeMesh" id=2] [sub_resource type="CubeMesh" id=2]
material = SubResource( 1 ) material = SubResource( 1 )
size = Vector3( 1, 0.01, 0.01 ) size = Vector3( 1, 0.01, 0.01 )
[sub_resource type="SpatialMaterial" id=3] [sub_resource type="ShaderMaterial" id=3]
albedo_color = Color( 0.866667, 0.917647, 0.984314, 1 ) shader = ExtResource( 1 )
shader_param/albedo = Color( 0.866667, 0.917647, 0.984314, 1 )
[sub_resource type="PrismMesh" id=4] [sub_resource type="PrismMesh" id=4]
material = SubResource( 3 ) material = SubResource( 3 )

View File

@ -1,21 +1,12 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://data/spell_effects/textures/small_star.png" type="Texture" id=1] [ext_resource path="res://data/spell_effects/textures/small_star.png" type="Texture" id=1]
[ext_resource path="res://data/shaders/2_simple_particle_billboard_shader.shader" type="Shader" id=2]
[sub_resource type="ShaderMaterial" id=1]
[sub_resource type="SpatialMaterial" id=1] shader = ExtResource( 2 )
flags_transparent = true shader_param/albedo = Color( 1, 1, 1, 1 )
flags_unshaded = true shader_param/texture_albedo = ExtResource( 1 )
flags_do_not_receive_shadows = true
vertex_color_use_as_albedo = true
params_specular_mode = 4
params_blend_mode = 1
params_cull_mode = 2
params_billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=2] [sub_resource type="QuadMesh" id=2]
material = SubResource( 1 ) material = SubResource( 1 )

View File

@ -1,20 +1,12 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://data/spell_effects/textures/star.png" type="Texture" id=1] [ext_resource path="res://data/spell_effects/textures/star.png" type="Texture" id=1]
[ext_resource path="res://data/shaders/2_simple_particle_billboard_shader.shader" type="Shader" id=2]
[sub_resource type="ShaderMaterial" id=1]
[sub_resource type="SpatialMaterial" id=1] shader = ExtResource( 2 )
flags_transparent = true shader_param/albedo = Color( 0.0627451, 0.741176, 0.619608, 1 )
flags_unshaded = true shader_param/texture_albedo = ExtResource( 1 )
vertex_color_use_as_albedo = true
params_specular_mode = 4
params_blend_mode = 1
params_billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
albedo_color = Color( 0.0627451, 0.741176, 0.619608, 1 )
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=2] [sub_resource type="QuadMesh" id=2]
material = SubResource( 1 ) material = SubResource( 1 )

View File

@ -1,39 +1,26 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://data/spell_effects/textures/main_texture.png" type="Texture" id=1] [ext_resource path="res://data/spell_effects/textures/main_texture.png" type="Texture" id=1]
[ext_resource path="res://data/spell_effects/textures/big_glow.png" type="Texture" id=2] [ext_resource path="res://data/spell_effects/textures/big_glow.png" type="Texture" id=2]
[ext_resource path="res://data/shaders/2_simple_particle_billboard_shader.shader" type="Shader" id=3]
[ext_resource path="res://data/shaders/3_simple_y_billboard.shader" type="Shader" id=4]
[sub_resource type="ShaderMaterial" id=1]
[sub_resource type="SpatialMaterial" id=1] shader = ExtResource( 3 )
flags_transparent = true shader_param/albedo = Color( 1, 1, 1, 1 )
flags_unshaded = true shader_param/texture_albedo = ExtResource( 1 )
vertex_color_use_as_albedo = true
params_specular_mode = 4
params_blend_mode = 1
params_cull_mode = 2
params_billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=2] [sub_resource type="QuadMesh" id=2]
material = SubResource( 1 ) material = SubResource( 1 )
size = Vector2( 0.1, 0.1 ) size = Vector2( 0.1, 0.1 )
[sub_resource type="SpatialMaterial" id=3] [sub_resource type="ShaderMaterial" id=5]
flags_transparent = true shader = ExtResource( 4 )
flags_unshaded = true shader_param/albedo = Color( 0.027451, 0.537255, 0.317647, 1 )
vertex_color_use_as_albedo = true shader_param/texture_albedo = ExtResource( 2 )
params_specular_mode = 4
params_blend_mode = 1
params_cull_mode = 2
params_billboard_mode = 1
albedo_color = Color( 0.027451, 0.537255, 0.317647, 1 )
albedo_texture = ExtResource( 2 )
[sub_resource type="QuadMesh" id=4] [sub_resource type="QuadMesh" id=4]
material = SubResource( 3 ) material = SubResource( 5 )
size = Vector2( 0.3, 0.3 ) size = Vector2( 0.3, 0.3 )
[node name="NatureCast" type="Spatial"] [node name="NatureCast" type="Spatial"]

View File

@ -1,36 +1,23 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=8 format=2]
[ext_resource path="res://data/spell_effects/textures/arrows.png" type="Texture" id=1] [ext_resource path="res://data/spell_effects/textures/arrows.png" type="Texture" id=1]
[ext_resource path="res://data/materials/2_simple_particle_billboard.tres" type="Material" id=2]
[ext_resource path="res://data/shaders/3_simple_y_billboard.shader" type="Shader" id=3]
[sub_resource type="SpatialMaterial" id=1] [sub_resource type="QuadMesh" id=1]
flags_unshaded = true material = ExtResource( 2 )
vertex_color_use_as_albedo = true
params_specular_mode = 4
params_blend_mode = 1
params_cull_mode = 2
params_billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
[sub_resource type="QuadMesh" id=2]
material = SubResource( 1 )
size = Vector2( 0.02, 0.02 ) size = Vector2( 0.02, 0.02 )
[sub_resource type="SpatialMaterial" id=3] [sub_resource type="ShaderMaterial" id=2]
flags_transparent = true shader = ExtResource( 3 )
flags_unshaded = true shader_param/albedo = Color( 0.0470588, 0.898039, 0.380392, 0.435294 )
params_specular_mode = 4 shader_param/texture_albedo = ExtResource( 1 )
params_blend_mode = 1
params_cull_mode = 2
albedo_color = Color( 0.0470588, 0.898039, 0.380392, 0.435294 )
albedo_texture = ExtResource( 1 )
[sub_resource type="QuadMesh" id=4] [sub_resource type="QuadMesh" id=3]
material = SubResource( 3 ) material = SubResource( 2 )
size = Vector2( 0.8, 0.8 ) size = Vector2( 0.8, 0.8 )
[sub_resource type="Animation" id=5] [sub_resource type="Animation" id=4]
length = 2.0 length = 2.0
loop = true loop = true
tracks/0/type = "value" tracks/0/type = "value"
@ -65,7 +52,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0 )
amount = 3 amount = 3
lifetime = 0.8 lifetime = 0.8
explosiveness = 0.61 explosiveness = 0.61
mesh = SubResource( 2 ) mesh = SubResource( 1 )
emission_shape = 2 emission_shape = 2
emission_box_extents = Vector3( 0.3, 0.2, 0.3 ) emission_box_extents = Vector3( 0.3, 0.2, 0.3 )
direction = Vector3( 0, 1, 0 ) direction = Vector3( 0, 1, 0 )
@ -86,10 +73,10 @@ hue_variation = -0.24
hue_variation_random = 1.0 hue_variation_random = 1.0
[node name="MeshInstance" type="MeshInstance" parent="."] [node name="MeshInstance" type="MeshInstance" parent="."]
transform = Transform( -0.395711, 0.858146, -1.3981e-07, 0, -1.53958e-07, -0.944988, -0.858146, -0.395711, 6.44696e-08, 0, 0, 0 ) transform = Transform( 0.8, 0, 0, 0, -3.49691e-08, -0.8, 0, 0.8, -3.49691e-08, 0, 0, 0 )
mesh = SubResource( 4 ) mesh = SubResource( 3 )
material/0 = null material/0 = null
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Anim" autoplay = "Anim"
anims/Anim = SubResource( 5 ) anims/Anim = SubResource( 4 )

View File

@ -3,5 +3,9 @@
[ext_resource path="res://data/shaders/1_standard_shader.tres" type="Shader" id=1] [ext_resource path="res://data/shaders/1_standard_shader.tres" type="Shader" id=1]
[resource] [resource]
shader = ExtResource( 1 ) shader = ExtResource( 1 )