add shadow decals

This commit is contained in:
Teatov 2025-02-27 02:18:21 +10:00
parent 352004a393
commit 77764f2892
7 changed files with 85 additions and 5 deletions

BIN
assets/textures/shadow_decal.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://xi8bgmkq6kiq"
path.s3tc="res://.godot/imported/shadow_decal.png-073e260871c9e77182082d3533116712.s3tc.ctex"
path.etc2="res://.godot/imported/shadow_decal.png-073e260871c9e77182082d3533116712.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://assets/textures/shadow_decal.png"
dest_files=["res://.godot/imported/shadow_decal.png-073e260871c9e77182082d3533116712.s3tc.ctex", "res://.godot/imported/shadow_decal.png-073e260871c9e77182082d3533116712.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -122,6 +122,9 @@ attack={
[layer_names] [layer_names]
3d_render/layer_6="characters"
3d_render/layer_7="projectiles"
3d_render/layer_8="props"
3d_physics/layer_5="player" 3d_physics/layer_5="player"
3d_physics/layer_6="projectiles" 3d_physics/layer_6="projectiles"

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://c8gqrealje3o"]
[ext_resource type="Texture2D" uid="uid://xi8bgmkq6kiq" path="res://assets/textures/shadow_decal.png" id="1_25nh0"]
[node name="ShadowDecal" type="Decal"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, 0)
size = Vector3(1, 6, 1)
texture_albedo = ExtResource("1_25nh0")
modulate = Color(0, 0, 0, 0.74902)
normal_fade = 0.75
upper_fade = 0.025
cull_mask = 1

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://cksoaevb5sloo"] [gd_scene load_steps=6 format=3 uid="uid://cksoaevb5sloo"]
[ext_resource type="Script" path="res://scripts/enemies/projectile_spawner.gd" id="1_fdaky"] [ext_resource type="Script" path="res://scripts/enemies/projectile_spawner.gd" id="1_fdaky"]
[ext_resource type="PackedScene" uid="uid://cejn8wfgw14xs" path="res://scenes/projectiles/projectile.tscn" id="2_p0btw"] [ext_resource type="PackedScene" uid="uid://cejn8wfgw14xs" path="res://scenes/projectiles/projectile.tscn" id="2_p0btw"]
[ext_resource type="PackedScene" uid="uid://c8gqrealje3o" path="res://scenes/effects/shadow_decal.tscn" id="3_yqwru"]
[sub_resource type="BoxMesh" id="BoxMesh_860q6"] [sub_resource type="BoxMesh" id="BoxMesh_860q6"]
@ -18,11 +19,18 @@ _velocity = Vector3(0, 0, -10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
layers = 128
cast_shadow = 0
mesh = SubResource("BoxMesh_860q6") mesh = SubResource("BoxMesh_860q6")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] [node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, -0.34) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, -0.34)
layers = 128
cast_shadow = 0
mesh = SubResource("CylinderMesh_esok8") mesh = SubResource("CylinderMesh_esok8")
[node name="Marker3D" type="Marker3D" parent="."] [node name="Marker3D" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -0.591) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -0.591)
[node name="ShadowDecal" parent="." instance=ExtResource("3_yqwru")]
size = Vector3(2.5, 6, 2.5)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=3 uid="uid://b73y71y3efmv"] [gd_scene load_steps=30 format=3 uid="uid://b73y71y3efmv"]
[ext_resource type="Script" path="res://scripts/player/player.gd" id="1_xt3i8"] [ext_resource type="Script" path="res://scripts/player/player.gd" id="1_xt3i8"]
[ext_resource type="Material" uid="uid://cc18ee0wbfoud" path="res://resources/materials/debug/debug_player.tres" id="2_0p422"] [ext_resource type="Material" uid="uid://cc18ee0wbfoud" path="res://resources/materials/debug/debug_player.tres" id="2_0p422"]
@ -8,6 +8,7 @@
[ext_resource type="Material" uid="uid://bdi02rpvdukem" path="res://resources/materials/debug/debug_attack.tres" id="4_ll2ct"] [ext_resource type="Material" uid="uid://bdi02rpvdukem" path="res://resources/materials/debug/debug_attack.tres" id="4_ll2ct"]
[ext_resource type="Script" path="res://scripts/effects/bone_to_flatten.gd" id="6_cumn2"] [ext_resource type="Script" path="res://scripts/effects/bone_to_flatten.gd" id="6_cumn2"]
[ext_resource type="Script" path="res://scripts/effects/bone_flattener.gd" id="6_iug5b"] [ext_resource type="Script" path="res://scripts/effects/bone_flattener.gd" id="6_iug5b"]
[ext_resource type="PackedScene" uid="uid://c8gqrealje3o" path="res://scenes/effects/shadow_decal.tscn" id="9_vgb3d"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_tes4q"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_tes4q"]
animation = &"+idle_L" animation = &"+idle_L"
@ -104,6 +105,9 @@ radius = 2.0
height = 2.0 height = 2.0
is_hemisphere = true is_hemisphere = true
[sub_resource type="BoxMesh" id="BoxMesh_ti743"]
size = Vector3(5.005, 1, 5.935)
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
collision_layer = 16 collision_layer = 16
script = ExtResource("1_xt3i8") script = ExtResource("1_xt3i8")
@ -118,7 +122,7 @@ bones/6/rotation = Quaternion(-0.0323581, 2.46001e-07, 8.00608e-09, 0.999476)
bones/7/rotation = Quaternion(0.123965, -2.40098e-07, -2.92456e-09, 0.992287) bones/7/rotation = Quaternion(0.123965, -2.40098e-07, -2.92456e-09, 0.992287)
bones/7/scale = Vector3(1, 1, 1) bones/7/scale = Vector3(1, 1, 1)
bones/8/rotation = Quaternion(-0.0917916, -2.67583e-15, 2.18848e-08, 0.995778) bones/8/rotation = Quaternion(-0.0917916, -2.67583e-15, 2.18848e-08, 0.995778)
bones/9/position = Vector3(-0.0725585, 0.011605, 0.0832403) bones/9/position = Vector3(-0.0690518, 0.0111183, 0.0874259)
bones/9/rotation = Quaternion(1.15202e-07, 0.707107, 0.707107, -5.33851e-08) bones/9/rotation = Quaternion(1.15202e-07, 0.707107, 0.707107, -5.33851e-08)
bones/9/scale = Vector3(1, 1, 1) bones/9/scale = Vector3(1, 1, 1)
bones/21/rotation = Quaternion(0.19747, 0.678974, 0.678974, -0.19747) bones/21/rotation = Quaternion(0.19747, 0.678974, 0.678974, -0.19747)
@ -132,7 +136,7 @@ bones/45/scale = Vector3(1, 1, 1)
bones/46/rotation = Quaternion(-0.0181733, 2.38379e-07, 1.14098e-08, 0.999835) bones/46/rotation = Quaternion(-0.0181733, 2.38379e-07, 1.14098e-08, 0.999835)
bones/47/rotation = Quaternion(-1.20807e-07, 0.993087, -0.117383, 7.85287e-07) bones/47/rotation = Quaternion(-1.20807e-07, 0.993087, -0.117383, 7.85287e-07)
bones/49/rotation = Quaternion(-0.034235, -3.57418e-07, 8.86969e-08, 0.999414) bones/49/rotation = Quaternion(-0.034235, -3.57418e-07, 8.86969e-08, 0.999414)
bones/50/rotation = Quaternion(-0.142502, -0.692599, -0.692599, 0.142502) bones/50/rotation = Quaternion(-0.20044, -0.678103, -0.678103, 0.20044)
bones/51/rotation = Quaternion(0.403888, -2.98082e-07, -3.85178e-07, 0.914808) bones/51/rotation = Quaternion(0.403888, -2.98082e-07, -3.85178e-07, 0.914808)
bones/51/scale = Vector3(1, 1, 1) bones/51/scale = Vector3(1, 1, 1)
bones/52/rotation = Quaternion(-0.512846, 3.82068e-07, 4.27952e-07, 0.858481) bones/52/rotation = Quaternion(-0.512846, 3.82068e-07, 4.27952e-07, 0.858481)
@ -250,9 +254,11 @@ bones/176/rotation = Quaternion(0.0296713, 1.1925e-07, -7.47368e-09, 0.99956)
bones/180/rotation = Quaternion(-0.730424, 1.08982e-07, 2.31437e-07, 0.682994) bones/180/rotation = Quaternion(-0.730424, 1.08982e-07, 2.31437e-07, 0.682994)
[node name="Mesh" parent="Model/Armature/Skeleton3D" index="0"] [node name="Mesh" parent="Model/Armature/Skeleton3D" index="0"]
layers = 32
cast_shadow = 0 cast_shadow = 0
[node name="MeshBat" parent="Model/Armature/Skeleton3D" index="1"] [node name="MeshBat" parent="Model/Armature/Skeleton3D" index="1"]
layers = 32
cast_shadow = 0 cast_shadow = 0
[node name="AnimationPlayer" parent="Model" index="1"] [node name="AnimationPlayer" parent="Model" index="1"]
@ -305,4 +311,11 @@ visible = false
material_override = SubResource("StandardMaterial3D_m1xj5") material_override = SubResource("StandardMaterial3D_m1xj5")
mesh = SubResource("SphereMesh_kqbjh") mesh = SubResource("SphereMesh_kqbjh")
[node name="ShadowDecal" parent="." instance=ExtResource("9_vgb3d")]
size = Vector3(1.5, 6, 1.5)
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.590721, 0)
mesh = SubResource("BoxMesh_ti743")
[editable path="Model"] [editable path="Model"]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://cejn8wfgw14xs"] [gd_scene load_steps=6 format=3 uid="uid://cejn8wfgw14xs"]
[ext_resource type="Script" path="res://scripts/projectiles/projectile.gd" id="1_kv6x5"] [ext_resource type="Script" path="res://scripts/projectiles/projectile.gd" id="1_kv6x5"]
[ext_resource type="Material" uid="uid://cux40v5s5sok3" path="res://resources/materials/debug/debug_projectile.tres" id="2_b024o"] [ext_resource type="Material" uid="uid://cux40v5s5sok3" path="res://resources/materials/debug/debug_projectile.tres" id="2_b024o"]
[ext_resource type="PackedScene" uid="uid://c8gqrealje3o" path="res://scenes/effects/shadow_decal.tscn" id="3_2dqcj"]
[sub_resource type="SphereShape3D" id="SphereShape3D_vc8th"] [sub_resource type="SphereShape3D" id="SphereShape3D_vc8th"]
radius = 0.25 radius = 0.25
@ -21,4 +22,8 @@ _collision_debug_material = ExtResource("2_b024o")
shape = SubResource("SphereShape3D_vc8th") shape = SubResource("SphereShape3D_vc8th")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."]
layers = 64
cast_shadow = 0
mesh = SubResource("SphereMesh_ctqwx") mesh = SubResource("SphereMesh_ctqwx")
[node name="ShadowDecal" parent="." instance=ExtResource("3_2dqcj")]