Add test shader for godrays, use rigidbodies to put all spawned items on the ground

This commit is contained in:
2025-06-28 12:26:26 -07:00
parent f33616dda4
commit cf03c75ada
12 changed files with 136 additions and 18 deletions

BIN
UI Mockup.psd Normal file

Binary file not shown.

View File

@@ -1,13 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://b07srt3lckt4e"]
[gd_scene load_steps=4 format=3 uid="uid://b07srt3lckt4e"]
[ext_resource type="Script" uid="uid://2xddsc0pjykd" path="res://src/items/accessory/Accessory.cs" id="1_ikyk2"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_x6u08"]
height = 0.725098
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_1ceef"]
radius = 0.470016
[node name="Accessory" type="Node3D"]
[node name="Accessory" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_ikyk2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_x6u08")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4

View File

@@ -1,13 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://dorr7v1tkeiy0"]
[gd_scene load_steps=4 format=3 uid="uid://dorr7v1tkeiy0"]
[ext_resource type="Script" uid="uid://bxvre2y2caa3h" path="res://src/items/armor/Armor.cs" id="1_cmjpq"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_e2a3b"]
height = 0.725098
[sub_resource type="BoxShape3D" id="BoxShape3D_qdeu2"]
size = Vector3(0.778381, 0.929947, 0.731567)
[node name="Armor" type="Node3D"]
[node name="Armor" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_cmjpq")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_e2a3b")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4

View File

@@ -1,13 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://c6w7dpk0hurj0"]
[gd_scene load_steps=4 format=3 uid="uid://c6w7dpk0hurj0"]
[ext_resource type="Script" uid="uid://cyqibeq07rjr" path="res://src/items/consumable/ConsumableItem.cs" id="1_26bad"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6sghs"]
height = 0.725098
[sub_resource type="BoxShape3D" id="BoxShape3D_7mh0f"]
size = Vector3(0.778381, 0.929947, 0.731567)
[node name="ConsumableItem" type="Node3D"]
[node name="ConsumableItem" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_26bad")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_6sghs")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4
@@ -25,5 +38,4 @@ texture_filter = 0
render_priority = 100
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481)
shape = SubResource("BoxShape3D_7mh0f")

View File

@@ -1,20 +1,32 @@
[gd_scene load_steps=3 format=3 uid="uid://d0pl1n1jf77jm"]
[gd_scene load_steps=4 format=3 uid="uid://d0pl1n1jf77jm"]
[ext_resource type="Script" uid="uid://bl16bjcbosq5j" path="res://src/items/effect/EffectItem.cs" id="1_yw2rj"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_yw2rj"]
height = 0.725098
[sub_resource type="BoxShape3D" id="BoxShape3D_03cqg"]
size = Vector3(0.778381, 0.929947, 0.731567)
[node name="EffectItem" type="Node3D"]
[node name="EffectItem" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_yw2rj")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_yw2rj")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481)
shape = SubResource("BoxShape3D_03cqg")
[node name="Sprite" type="Sprite3D" parent="Pickup"]

View File

@@ -1,13 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://1fl6s352e2ej"]
[gd_scene load_steps=4 format=3 uid="uid://1fl6s352e2ej"]
[ext_resource type="Script" uid="uid://dj28ol2cpeiwm" path="res://src/items/throwable/ThrowableItem.cs" id="1_nac2l"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_h33kk"]
height = 0.725098
[sub_resource type="BoxShape3D" id="BoxShape3D_03cqg"]
size = Vector3(0.778381, 0.929947, 0.731567)
[node name="ThrowableItem" type="Node3D"]
[node name="ThrowableItem" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_nac2l")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_h33kk")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4

View File

@@ -1,13 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://db206brufi83s"]
[gd_scene load_steps=4 format=3 uid="uid://db206brufi83s"]
[ext_resource type="Script" uid="uid://bq8aaf1ae4afh" path="res://src/items/weapons/Weapon.cs" id="1_7pkyf"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1051i"]
height = 0.725098
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wll7p"]
radius = 0.470016
[node name="Weapon" type="Node3D"]
[node name="Weapon" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_7pkyf")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
shape = SubResource("CylinderShape3D_1051i")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4

View File

@@ -58,7 +58,7 @@ public partial class MonsterRoom : DungeonRoom
var selectedItem = database.PickItem<InventoryItem>();
var duplicated = selectedItem.Duplicate((int)DuplicateFlags.UseInstantiation) as Node3D;
duplicated.Position = new Vector3(spawnPoint.Position.X, -0.5f, spawnPoint.Position.Z);
duplicated.Position = new Vector3(spawnPoint.Position.X, -1.5f, spawnPoint.Position.Z);
AddChild(duplicated);
}
}

View File

@@ -867,11 +867,11 @@ transform = Transform3D(0.857993, 0, 0.513661, 0, 1, 0, -0.513661, 0, 0.857993,
shape = SubResource("BoxShape3D_xh2ej")
[node name="Ground" type="StaticBody3D" parent="Collision"]
collision_layer = 4
collision_layer = 5
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Collision/Ground"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.4904, -3.7991, 1.76942)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.4904, -4.20887, 1.76942)
shape = SubResource("BoxShape3D_aqomv")
debug_color = Color(0.937255, 0, 0.623529, 1)

View File

@@ -541,7 +541,7 @@ flip_v = true
[node name="Camera" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="Camera"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.003, 1.62599, 0.482136)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.003, 1.4569, 0.482136)
cull_mask = 1048569
fov = 45.0
near = 0.001

View File

@@ -0,0 +1,41 @@
shader_type spatial;
render_mode blend_add, depth_draw_opaque, cull_back, diffuse_burley, shadows_disabled;
uniform float alpha : hint_range(0.0, 1.0) = 0.5;
uniform float rim_power : hint_range(0.0, 5.0) = 1.0;
uniform sampler2D texture_emission : source_color, hint_default_black,filter_linear_mipmap,repeat_enable;
uniform sampler2D gradient : source_color, hint_default_black,filter_linear_mipmap,repeat_enable;
uniform vec4 emission : source_color;
uniform float emission_energy : hint_range(0.0, 1.0) = 0.5;
uniform vec3 uv1_scale = vec3(5.0, 0.0, 0.0);
uniform vec3 uv1_offset = vec3(0.0, 1.0, 0.0); //change y to whooooosh effect
varying vec2 base_uv;
// rotate on 90 degrees
vec2 rotateUV(vec2 uv) {
return vec2(1.0 * (uv.y - 0.5) + 0.5, -1.0 * (uv.y - 0.5) + 0.5);
}
void vertex() {
base_uv = rotateUV(UV);
UV = UV * uv1_scale.xy + uv1_offset.xy;
// UV.y += TIME * 0.02; // If you need animation, this needs some work.
}
void fragment() {
vec3 fallof = texture(gradient, base_uv).rgb;
float fresnel = pow(1.0 - dot(normalize(NORMAL), normalize(VIEW)), rim_power);
float fade = mix(1.0, -1.0, fresnel);
ROUGHNESS = 0.0;
SPECULAR = 0.0;
vec3 emission_tex = texture(texture_emission, UV).rgb;
EMISSION = (emission.rgb + emission_tex) * emission_energy * fallof;
ALPHA = clamp(fade, 0.0, 1.0) * EMISSION.r * alpha;
}

View File

@@ -0,0 +1 @@
uid://byyd6fao8lvi7