From 89a53457d29ce43c799dcdeca7a0ecc72dbbf984 Mon Sep 17 00:00:00 2001 From: betalars Date: Mon, 24 Feb 2025 16:09:51 +0100 Subject: [PATCH] create foam and include graffiti in first station --- .../transition/first_platform.tscn | 96 ++++++++++++++----- .../transition/shaders/platform_foam.tres | 16 ++++ .../transition/shaders/spray_noise.png | 3 + .../transition/shaders/spray_noise.png.import | 34 +++++++ .../transition/shaders/station_foam.gdshader | 51 ++++++++++ .../transition/shaders/station_waves.gdshader | 2 +- .../transition/time_sparks.gdshader | 2 +- 7 files changed, 178 insertions(+), 26 deletions(-) create mode 100644 src/base-environments/transition/shaders/platform_foam.tres create mode 100644 src/base-environments/transition/shaders/spray_noise.png create mode 100644 src/base-environments/transition/shaders/spray_noise.png.import create mode 100644 src/base-environments/transition/shaders/station_foam.gdshader diff --git a/src/base-environments/transition/first_platform.tscn b/src/base-environments/transition/first_platform.tscn index c0f8758..8095ecc 100644 --- a/src/base-environments/transition/first_platform.tscn +++ b/src/base-environments/transition/first_platform.tscn @@ -1,9 +1,25 @@ -[gd_scene load_steps=20 format=3 uid="uid://dgxujvk66rka6"] +[gd_scene load_steps=28 format=3 uid="uid://dgxujvk66rka6"] [ext_resource type="PackedScene" uid="uid://cb4m4oe32guqi" path="res://base-environments/transition/import/first_station.glb" id="1_yerc2"] [ext_resource type="Shader" path="res://base-environments/transition/time_sparks.gdshader" id="2_4y17u"] +[ext_resource type="PackedScene" uid="uid://bk1l1a7eae838" path="res://base-environments/transition/misc/subway_map.tscn" id="2_5npvd"] [ext_resource type="Texture2D" uid="uid://cxsne8gg5fmca" path="res://base-environments/transition/shaders/time_spark.png" id="3_cbtb8"] [ext_resource type="VoxelGIData" uid="uid://bxv4p0cx0u1vu" path="res://base-environments/transition/test_gi.res" id="4_nmgvo"] +[ext_resource type="Material" uid="uid://dmmkkclq8xlvu" path="res://base-environments/transition/shaders/platform_foam.tres" id="5_32vcv"] +[ext_resource type="Texture2D" uid="uid://c7ks4lvp3aw64" path="res://base-environments/transition/misc/annalena_graffiti_albedo.png" id="7_tid2w"] +[ext_resource type="Texture2D" uid="uid://byovh27jwtbhh" path="res://base-environments/transition/misc/annalena_graffiti_orm.png" id="8_xh1hp"] +[ext_resource type="Texture2D" uid="uid://jtr7v163pfy7" path="res://base-environments/transition/misc/blender_graffiti_albedo.png" id="9_bvylv"] +[ext_resource type="Texture2D" uid="uid://cwjr0xq64hdsw" path="res://base-environments/transition/misc/blender_graffiti_orm.png" id="10_xrnct"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_sjsoq"] +viewport_path = NodePath("first_station/MeshInstance3D/SubViewport") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cb8p6"] +resource_local_to_scene = true +albedo_texture = SubResource("ViewportTexture_sjsoq") + +[sub_resource type="QuadMesh" id="QuadMesh_d1dx0"] +size = Vector2(1.505, 1) [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_nspcl"] sky_top_color = Color(0.138464, 0.0447571, 0.169373, 1) @@ -37,7 +53,7 @@ fog_height_density = 0.5 adjustment_enabled = true [sub_resource type="ShaderMaterial" id="ShaderMaterial_4tj6b"] -render_priority = 0 +render_priority = 3 shader = ExtResource("2_4y17u") shader_parameter/spark_texture = ExtResource("3_cbtb8") @@ -74,27 +90,19 @@ color_initial_ramp = SubResource("GradientTexture1D_7joox") size = Vector2(1, 150) orientation = 0 -[sub_resource type="FastNoiseLite" id="FastNoiseLite_yuxff"] -frequency = 0.0038 +[sub_resource type="Gradient" id="Gradient_weiut"] +offsets = PackedFloat32Array(0, 0.99726) -[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_hmikn"] -noise = SubResource("FastNoiseLite_yuxff") - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_fkute"] -transparency = 1 -depth_draw_mode = 1 -albedo_texture = SubResource("NoiseTexture2D_hmikn") -billboard_mode = 3 -billboard_keep_scale = true -particles_anim_h_frames = 1 -particles_anim_v_frames = 1 -particles_anim_loop = false +[sub_resource type="GradientTexture1D" id="GradientTexture1D_7odmj"] +gradient = SubResource("Gradient_weiut") [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gayoc"] emission_shape_offset = Vector3(1.74, 0, 0) emission_shape_scale = Vector3(0.3, 0.3, 40) emission_shape = 3 emission_box_extents = Vector3(1, 1, 1) +angle_min = -180.0 +angle_max = 180.0 direction = Vector3(0, 10, 1) spread = 0.0 initial_velocity_min = 6.0 @@ -102,8 +110,9 @@ initial_velocity_max = 10.0 gravity = Vector3(-10, -9.8, 5) damping_min = 4.0 damping_max = 8.0 -scale_min = 0.1 -scale_max = 0.5 +scale_min = 0.5 +scale_max = 1.5 +color_initial_ramp = SubResource("GradientTexture1D_7odmj") turbulence_enabled = true turbulence_noise_strength = 0.1 turbulence_influence_min = 0.01 @@ -116,6 +125,16 @@ orientation = 2 [node name="first_station" parent="." instance=ExtResource("1_yerc2")] +[node name="MeshInstance3D" type="MeshInstance3D" parent="first_station"] +transform = Transform3D(0, 0, 1.46175, 0, 1.46175, 0, -1.46175, 0, 0, 0.124229, 1.13951, -12.668) +material_override = SubResource("StandardMaterial3D_cb8p6") +mesh = SubResource("QuadMesh_d1dx0") + +[node name="SubViewport" type="SubViewport" parent="first_station/MeshInstance3D"] +size = Vector2i(2896, 2048) + +[node name="SubwayMap" parent="first_station/MeshInstance3D/SubViewport" instance=ExtResource("2_5npvd")] + [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_hovki") @@ -286,7 +305,6 @@ spot_angle_attenuation = 0.517633 [node name="GPUParticles3D" type="GPUParticles3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.8785, 1.08384, -32.4645) -visible = false sorting_offset = 100.0 material_override = SubResource("ShaderMaterial_4tj6b") amount = 10 @@ -318,12 +336,42 @@ size = Vector3(20, 5.83698, 79.5936) data = ExtResource("4_nmgvo") [node name="GPUParticles3D3" type="GPUParticles3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.18283, 1.0098, -32.3954) -visible = false -material_override = SubResource("StandardMaterial3D_fkute") -amount = 2000 +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.18283, 0.258846, -32.3954) +material_override = ExtResource("5_32vcv") +amount = 1000 +lifetime = 1.5 speed_scale = 0.5 -explosiveness = 0.1 +explosiveness = 0.4 randomness = 1.0 +visibility_aabb = AABB(-4, -4, -30, 8, 8, 60) +local_coords = true +draw_order = 3 process_material = SubResource("ParticleProcessMaterial_gayoc") draw_pass_1 = SubResource("PlaneMesh_8c2us") + +[node name="GPUParticles3D4" type="GPUParticles3D" parent="."] +transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -6.80088, 0.258846, -32.3954) +material_override = ExtResource("5_32vcv") +amount = 1000 +lifetime = 1.5 +speed_scale = 0.5 +explosiveness = 0.4 +randomness = 1.0 +visibility_aabb = AABB(-4, -4, -30, 8, 8, 60) +local_coords = true +draw_order = 3 +process_material = SubResource("ParticleProcessMaterial_gayoc") +draw_pass_1 = SubResource("PlaneMesh_8c2us") + +[node name="Decal" type="Decal" parent="."] +transform = Transform3D(1.29235, 0, -5.64905e-08, -5.64905e-08, 2.46928e-15, -1.29235, 0, 1.29235, 2.46928e-15, 0.0490856, 1.34774, -63.5643) +size = Vector3(4, 2, 2) +texture_albedo = ExtResource("7_tid2w") +texture_orm = ExtResource("8_xh1hp") + +[node name="Decal2" type="Decal" parent="."] +transform = Transform3D(1.59383, 0, -6.96684e-08, -6.96684e-08, 3.0453e-15, -1.59383, 0, 1.59383, 3.0453e-15, 0.0490856, 1.16765, -65.1685) +size = Vector3(4, 2, 2) +texture_albedo = ExtResource("9_bvylv") +texture_orm = ExtResource("10_xrnct") +albedo_mix = 0.92 diff --git a/src/base-environments/transition/shaders/platform_foam.tres b/src/base-environments/transition/shaders/platform_foam.tres new file mode 100644 index 0000000..2c24673 --- /dev/null +++ b/src/base-environments/transition/shaders/platform_foam.tres @@ -0,0 +1,16 @@ +[gd_resource type="ShaderMaterial" load_steps=5 format=3 uid="uid://dmmkkclq8xlvu"] + +[ext_resource type="Shader" path="res://base-environments/transition/shaders/station_foam.gdshader" id="1_64pgk"] +[ext_resource type="Texture2D" uid="uid://dr6syuk6hpcvd" path="res://base-environments/transition/shaders/spray_noise.png" id="2_6cag6"] + +[sub_resource type="Gradient" id="Gradient_fttg7"] +colors = PackedColorArray(0.177466, 0.446826, 0.531851, 1, 0.968177, 0.843068, 0.745439, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_df7bf"] +gradient = SubResource("Gradient_fttg7") + +[resource] +render_priority = 3 +shader = ExtResource("1_64pgk") +shader_parameter/spray_texture = ExtResource("2_6cag6") +shader_parameter/lifetime_gradient = SubResource("GradientTexture1D_df7bf") diff --git a/src/base-environments/transition/shaders/spray_noise.png b/src/base-environments/transition/shaders/spray_noise.png new file mode 100644 index 0000000..1d7b987 --- /dev/null +++ b/src/base-environments/transition/shaders/spray_noise.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d81184486a0b55a96e6927124fbe2002c3f3d0d7748dc4ce4dc9e33f37634db6 +size 550074 diff --git a/src/base-environments/transition/shaders/spray_noise.png.import b/src/base-environments/transition/shaders/spray_noise.png.import new file mode 100644 index 0000000..0e11c37 --- /dev/null +++ b/src/base-environments/transition/shaders/spray_noise.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dr6syuk6hpcvd" +path="res://.godot/imported/spray_noise.png-b498ad2e8811ce0683f7f09d65b9f1df.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://base-environments/transition/shaders/spray_noise.png" +dest_files=["res://.godot/imported/spray_noise.png-b498ad2e8811ce0683f7f09d65b9f1df.ctex"] + +[params] + +compress/mode=3 +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 diff --git a/src/base-environments/transition/shaders/station_foam.gdshader b/src/base-environments/transition/shaders/station_foam.gdshader new file mode 100644 index 0000000..021f613 --- /dev/null +++ b/src/base-environments/transition/shaders/station_foam.gdshader @@ -0,0 +1,51 @@ +// NOTE: Shader automatically converted from Godot Engine 4.3.stable's StandardMaterial3D. + +shader_type spatial; +render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx; + + +uniform sampler2D spray_texture; +uniform sampler2D lifetime_gradient; +varying vec4 passtrough; + +void vertex() { + passtrough = INSTANCE_CUSTOM; + + // 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; + + // Billboard Keep Scale: Enabled + MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4( + vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0), + vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), + vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), + vec4(0.0, 0.0, 0.0, 1.0)); + + MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX); + + //passtrough = INSTANCE_CUSTOM; +} + +void fragment() { + ROUGHNESS = 0.2; + + vec2 uv = UV * 2.0 - COLOR.xy + (texture(spray_texture, UV * 1.5 + TIME * 0.2 + COLOR.xy * 4.0).zz - (TIME * 0.3)) * 0.2; + float mist = texture(spray_texture, UV*0.7 + TIME*0.2 - COLOR.xy).x * sin(pow(passtrough.y, 8.0)*PI); + float foam = (texture(spray_texture, uv).y -0.5) * 2.0 * sin(pow(passtrough.y, 0.5)*PI); + float mask = max(0, pow((1.3 - length(0.5-UV)*2.5), 2.0-passtrough.y)); + //ALPHA = min(1.0, max(0, texture(spray_texture, UV*0.7 - TIME*0.5 - COLOR.xy).x * sin(pow(passtrough.y, 4.0)*PI) + texture(spray_texture, uv).y -0.5) * 2.0 * sin(pow(passtrough.y, 0.3)*PI) * max(0, pow((1.3 - length(0.5-UV) * 2.0), 1.0+passtrough.y))); + ALPHA = min(1.0, max(0.0, (foam + mist) * mask)); + ALBEDO = texture(lifetime_gradient, vec2(passtrough.y, 0.5)).xyz; + BACKLIGHT = ALBEDO; + //EMISSION = COLOR.xyz * max(0, (1.5-pow(passtrough.y, 0.3)*2.0)); +} diff --git a/src/base-environments/transition/shaders/station_waves.gdshader b/src/base-environments/transition/shaders/station_waves.gdshader index a615add..8d20b46 100644 --- a/src/base-environments/transition/shaders/station_waves.gdshader +++ b/src/base-environments/transition/shaders/station_waves.gdshader @@ -1,5 +1,5 @@ shader_type spatial; -render_mode sss_mode_skin, depth_draw_always; +render_mode sss_mode_skin, depth_prepass_alpha; uniform vec3 displacement_strength = vec3(0.8, 0.3, 0.2); uniform vec3 w_scale = vec3(1.0, 1.0, 1.0); diff --git a/src/base-environments/transition/time_sparks.gdshader b/src/base-environments/transition/time_sparks.gdshader index fd17cf1..8d698a6 100644 --- a/src/base-environments/transition/time_sparks.gdshader +++ b/src/base-environments/transition/time_sparks.gdshader @@ -1,5 +1,5 @@ shader_type spatial; -render_mode unshaded, blend_add, fog_disabled, cull_disabled; +render_mode unshaded, blend_add, fog_disabled, cull_disabled, depth_draw_opaque; uniform sampler2D spark_texture; varying vec4 passtrough;