feat: level changes & kaleidoscope shield
This commit is contained in:
parent
74e68bcca1
commit
5b2aa6d128
5 changed files with 652 additions and 352 deletions
BIN
project/assets/effects/cracks_albedo.png
(Stored with Git LFS)
Normal file
BIN
project/assets/effects/cracks_albedo.png
(Stored with Git LFS)
Normal file
Binary file not shown.
40
project/assets/effects/cracks_albedo.png.import
Normal file
40
project/assets/effects/cracks_albedo.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cwiwjin51th2h"
|
||||
path="res://.godot/imported/cracks_albedo.png-4af2b561e7eb88637da923a926a6a253.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/effects/cracks_albedo.png"
|
||||
dest_files=["res://.godot/imported/cracks_albedo.png-4af2b561e7eb88637da923a926a6a253.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=3
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
|
@ -1,9 +1,41 @@
|
|||
shader_type spatial;
|
||||
render_mode cull_disabled, blend_mix, depth_prepass_alpha, unshaded;
|
||||
|
||||
group_uniforms Albedo;
|
||||
uniform vec3 color_modulation : source_color;
|
||||
uniform sampler2D color : source_color, hint_default_white;
|
||||
uniform float baseline_alpha : hint_range(0, 1);
|
||||
uniform float triplanar_scale = 1.0;
|
||||
|
||||
group_uniforms FresnelOutline;
|
||||
uniform float alpha_min : hint_range(0, 1) = 0.02;
|
||||
uniform float alpha_max : hint_range(0, 1) = 1.0;
|
||||
uniform float fresnel_start : hint_range(0, 1) = 0.1;
|
||||
uniform float fresnel_end : hint_range(0, 1) = 0.5;
|
||||
uniform float emission : hint_range(0, 1);
|
||||
|
||||
group_uniforms Damage;
|
||||
uniform sampler2D damage_map : hint_default_white, filter_linear_mipmap;
|
||||
|
||||
instance uniform float damage : hint_range(0, 1) = 0.0;
|
||||
|
||||
varying vec3 local_position;
|
||||
varying vec3 local_normal;
|
||||
|
||||
void vertex() {
|
||||
local_position = VERTEX;
|
||||
local_normal = NORMAL;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
ALBEDO = texture(color, UV * VIEW.xy).rgb;
|
||||
ALPHA = baseline_alpha + (1.0 - dot(NORMAL, VIEW)) * (1.0 - baseline_alpha);
|
||||
vec3 weights = abs(local_normal);
|
||||
weights /= weights.x + weights.y + weights.z;
|
||||
vec2 uv_x = vec2(local_position.z, local_position.y);
|
||||
vec2 uv_y = vec2(local_position.z, local_position.x);
|
||||
vec2 uv_z = vec2(local_position.x, local_position.y);
|
||||
vec2 uv = ((weights.y > weights.x && weights.y > weights.z ? uv_y : (weights.x > weights.z ? uv_x : uv_z)));
|
||||
vec4 sample = mix(texture(color, uv * triplanar_scale - vec2(0, TIME)), texture(color, uv + vec2(0, TIME)), 0.35);
|
||||
ALBEDO = sample.rgb * color_modulation;
|
||||
float damage_adjusted = (step(texture(damage_map, vec2(0.5) + uv).r, 1.0 - damage * 1.01));
|
||||
ALPHA = clamp(mix(alpha_min, alpha_max, smoothstep(fresnel_start, fresnel_end, 1.0 - dot(NORMAL, VIEW))) * sample.a, 0.0, 1.0) * damage_adjusted;
|
||||
EMISSION = ALBEDO * emission * ALPHA;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
[gd_resource type="ShaderMaterial" format=3 uid="uid://c2yn84yg4yspf"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://b3gr12o27c4ah" path="res://assets/effects/kaleidoscope_shield.gdshader" id="1_is1u6"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddaso2y8ooove" path="res://assets/materials/kaleidoscope_mosaic_albedo.png" id="2_7x4lx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cda6w3283bwgr" path="res://assets/materials/kaleidoscope_mosaic_gray_emission.png" id="2_7x4lx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwiwjin51th2h" path="res://assets/effects/cracks_albedo.png" id="3_o016t"]
|
||||
|
||||
[resource]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_is1u6")
|
||||
shader_parameter/color_modulation = Color(0.96699256, 0.00025182008, 0.84386754, 1)
|
||||
shader_parameter/color = ExtResource("2_7x4lx")
|
||||
shader_parameter/baseline_alpha = 0.0
|
||||
shader_parameter/triplanar_scale = 0.489
|
||||
shader_parameter/alpha_min = 0.03600000171
|
||||
shader_parameter/alpha_max = 1.0
|
||||
shader_parameter/fresnel_start = 0.2710000128725
|
||||
shader_parameter/fresnel_end = 1.0
|
||||
shader_parameter/emission = 1.0
|
||||
shader_parameter/damage_map = ExtResource("3_o016t")
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue