feat: character tech art
This commit is contained in:
parent
b6219135c5
commit
dce784a237
9 changed files with 69 additions and 40 deletions
|
|
@ -16493,13 +16493,8 @@ _subresources={
|
|||
"materials": {
|
||||
"Base": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://assets/character/player/player_body.tres",
|
||||
"use_external/path": "uid://4jw7ckdluil6"
|
||||
},
|
||||
"Boots": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/fallback_path": "res://assets/character/player/player_boots.tres",
|
||||
"use_external/path": "uid://c0khp3qs2pfx5"
|
||||
"use_external/fallback_path": "res://assets/character/player/skin_shader.tres",
|
||||
"use_external/path": "uid://dmfij86pa2ce4"
|
||||
},
|
||||
"ChokerBand": {
|
||||
"use_external/enabled": true,
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
[gd_scene format=3 uid="uid://c1g1vy67lf550"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://blaoym0srw5o5" path="res://assets/character/player/player.blend" id="1_1oybq"]
|
||||
[ext_resource type="Material" uid="uid://dmfij86pa2ce4" path="res://assets/character/player/skin_shader.tres" id="2_0o6ap"]
|
||||
|
||||
[node name="PlayerModel" unique_id=1710695753 instance=ExtResource("1_1oybq")]
|
||||
|
||||
[node name="HumanArmature" parent="." index="0" unique_id=1187060665]
|
||||
[node name="HumanArmature" parent="." index="0" unique_id=60790189]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
|
||||
|
||||
[node name="BlankCharacterMesh" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1628069397) index="0" unique_id=1487231879]
|
||||
[node name="BlankCharacterMesh" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1295955268) index="0" unique_id=1294452068]
|
||||
layers = 3
|
||||
material_override = ExtResource("2_0o6ap")
|
||||
|
||||
[node name="Eyes" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1295955268) index="4" unique_id=332871592]
|
||||
layers = 3
|
||||
|
||||
[node name="Eyes" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1628069397) index="4" unique_id=1208919417]
|
||||
layers = 3
|
||||
|
||||
[node name="Mouth" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1628069397) index="5" unique_id=1518783785]
|
||||
[node name="Mouth" parent="HumanArmature/Skeleton3D" parent_id_path=PackedInt32Array(1295955268) index="5" unique_id=926205139]
|
||||
layers = 3
|
||||
|
|
|
|||
|
|
@ -1,18 +1,15 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://4jw7ckdluil6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddaso2y8ooove" path="res://assets/materials/kaleidoscope_mosaic_albedo.png" id="1_3wsv7"]
|
||||
[ext_resource type="Texture2D" uid="uid://34f1swwafqoa" path="res://assets/materials/kaleidoscope_mosaic_emission.png" id="2_7ylji"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0yi45ldkax5s" path="res://assets/materials/kaleidoscope_mosaic_heightmap.png" id="3_cd41l"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwskfat6ut10d" path="res://assets/materials/kaleidoscope_mosaic_normal.png" id="4_8bxh1"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvjdobdajaloq" path="res://assets/materials/kaleidoscope_mosaic_orm.png" id="4_kwxth"]
|
||||
[ext_resource type="Material" uid="uid://drtkue0sg42tu" path="res://assets/character/player/skin.tres" id="4_o3a35"]
|
||||
|
||||
[resource]
|
||||
render_priority = -1
|
||||
next_pass = ExtResource("4_o3a35")
|
||||
diffuse_mode = 3
|
||||
specular_mode = 1
|
||||
albedo_texture = ExtResource("1_3wsv7")
|
||||
albedo_texture = ExtResource("2_7ylji")
|
||||
metallic = 0.33
|
||||
metallic_specular = 1.0
|
||||
metallic_texture = ExtResource("4_kwxth")
|
||||
|
|
@ -24,7 +21,7 @@ emission_texture = ExtResource("2_7ylji")
|
|||
normal_enabled = true
|
||||
normal_texture = ExtResource("4_8bxh1")
|
||||
heightmap_enabled = true
|
||||
heightmap_scale = 25.0
|
||||
heightmap_scale = 16.0
|
||||
heightmap_deep_parallax = true
|
||||
heightmap_min_layers = 8
|
||||
heightmap_max_layers = 32
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://drtkue0sg42tu"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cufv10vyjbn0x" path="res://assets/character/player/player_skin.png" id="1_bgydp"]
|
||||
[ext_resource type="Texture2D" uid="uid://da0k02xs2oecj" path="res://assets/character/player/player_skin_portfolio_ver.png" id="1_bgydp"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bgydp"]
|
||||
render_priority = 1
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
[gd_resource type="ShaderMaterial" format=3 uid="uid://dmfij86pa2ce4"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://briad1jwmkdw2" path="res://assets/character/shaders/player_skin.gdshader" id="1_6rrkd"]
|
||||
[ext_resource type="Texture2D" uid="uid://da0k02xs2oecj" path="res://assets/character/player/player_skin_portfolio_ver.png" id="2_thik8"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddaso2y8ooove" path="res://assets/materials/kaleidoscope_mosaic_albedo.png" id="3_i1ahx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cufv10vyjbn0x" path="res://assets/character/player/player_skin.png" id="2_thik8"]
|
||||
[ext_resource type="Texture2D" uid="uid://34f1swwafqoa" path="res://assets/materials/kaleidoscope_mosaic_emission.png" id="3_i1ahx"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0yi45ldkax5s" path="res://assets/materials/kaleidoscope_mosaic_heightmap.png" id="4_i1ahx"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwskfat6ut10d" path="res://assets/materials/kaleidoscope_mosaic_normal.png" id="4_thik8"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_thik8"]
|
||||
noise_type = 0
|
||||
frequency = 0.0103
|
||||
frequency = 0.007
|
||||
offset = Vector3(-151.31, 0, 0)
|
||||
fractal_octaves = 3
|
||||
fractal_lacunarity = 2.4
|
||||
fractal_gain = -0.432
|
||||
|
|
@ -21,7 +23,13 @@ invert = true
|
|||
render_priority = 0
|
||||
shader = ExtResource("1_6rrkd")
|
||||
shader_parameter/alpha_texture = SubResource("NoiseTexture2D_i1ahx")
|
||||
shader_parameter/health = 0.3510000166725
|
||||
shader_parameter/top_layer_albedo = ExtResource("2_thik8")
|
||||
shader_parameter/under_layer_albedo = ExtResource("3_i1ahx")
|
||||
shader_parameter/under_layer_normal = ExtResource("4_thik8")
|
||||
shader_parameter/under_layer_scale = 10.046
|
||||
shader_parameter/under_layer_depth = ExtResource("4_i1ahx")
|
||||
shader_parameter/under_layer_scale = 11.561
|
||||
shader_parameter/under_layer_depth_scale = 0.349
|
||||
shader_parameter/max_depth_layers = 128.0
|
||||
shader_parameter/min_depth_layers = 32.0
|
||||
shader_parameter/under_emission_strength = 0.052
|
||||
|
|
|
|||
|
|
@ -2,33 +2,60 @@ shader_type spatial;
|
|||
render_mode diffuse_toon, specular_disabled;
|
||||
|
||||
uniform sampler2D alpha_texture : hint_default_white, filter_linear;
|
||||
instance uniform float health : hint_range(0.0, 1.0) = 1.0;
|
||||
uniform float health : hint_range(0.0, 1.0) = 1.0;
|
||||
|
||||
group_uniforms TopLayer;
|
||||
uniform sampler2D top_layer_albedo : source_color, hint_default_black, filter_linear_mipmap_anisotropic;
|
||||
|
||||
group_uniforms UnderLayer;
|
||||
uniform sampler2D under_layer_albedo : source_color, hint_default_white;
|
||||
uniform sampler2D under_layer_albedo : source_color, hint_default_white, filter_linear_mipmap_anisotropic;
|
||||
uniform sampler2D under_layer_normal : hint_normal;
|
||||
uniform sampler2D under_layer_depth : hint_default_white, filter_linear_mipmap_anisotropic;
|
||||
uniform float under_layer_scale = 1.0;
|
||||
uniform float under_layer_depth_scale = 1.0;
|
||||
uniform float max_depth_layers = 128.0;
|
||||
uniform float min_depth_layers = 8.0;
|
||||
uniform float under_emission_strength = 0.5;
|
||||
|
||||
varying mat3 tangent_matrix;
|
||||
|
||||
vec2 uv_to_parallax(vec2 uv, vec3 view_direction, sampler2D depth_map, float depth_factor) {
|
||||
vec2 penetration = view_direction.xy * -depth_factor;
|
||||
float layer_count = mix(min_depth_layers, max_depth_layers, max(dot(vec3(0.0, 0.0, 1.0), view_direction), 0.0));
|
||||
float layer_separation = 1.0 / layer_count;
|
||||
vec2 uv_layer_shift = penetration / layer_count;
|
||||
vec2 uv_iterator = uv;
|
||||
float layer_depth_iterator = 0.0;
|
||||
float depth_iterator = 1.0 - (texture(depth_map, uv).r);
|
||||
while(layer_depth_iterator < depth_iterator) {
|
||||
uv_iterator -= uv_layer_shift;
|
||||
depth_iterator = 1.0 - (texture(depth_map, uv_iterator).r);
|
||||
layer_depth_iterator += layer_separation;
|
||||
}
|
||||
vec2 steep_parallax_uv = uv_iterator;
|
||||
float steep_parallax_depth = depth_iterator - layer_depth_iterator;
|
||||
float depth_distance = texture(depth_map, steep_parallax_uv).r - layer_depth_iterator + layer_separation;
|
||||
return mix(uv_iterator, steep_parallax_uv, steep_parallax_depth / (steep_parallax_depth - depth_distance));
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
mat4 model_mat = transpose(inverse(MODELVIEW_MATRIX));
|
||||
tangent_matrix = mat3(-(model_mat * vec4(TANGENT, 0.0)).xyz, (model_mat * vec4(BINORMAL, 0.0)).xyz, (model_mat * vec4(NORMAL, 0.0)).xyz);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 under_uv = UV * under_layer_scale;
|
||||
vec2 under_uv_parallax = uv_to_parallax(under_uv, normalize(normalize(-VERTEX) * tangent_matrix), under_layer_depth, under_layer_depth_scale);
|
||||
vec4 top_layer_sample = texture(top_layer_albedo, UV);
|
||||
vec4 under_layer_sample = texture(under_layer_albedo, under_uv);
|
||||
float alpha = clamp(step(0.0, health - texture(alpha_texture, UV).r) * top_layer_sample.a, 0.0, 1.0);
|
||||
ALBEDO = mix(under_layer_sample.rgb, top_layer_sample.rgb, alpha);
|
||||
if (alpha < 0.5) {
|
||||
NORMAL_MAP = texture(under_layer_normal, under_uv).rgb;
|
||||
EMISSION = under_layer_sample.rgb;
|
||||
vec4 under_layer_sample = texture(under_layer_albedo, under_uv_parallax);
|
||||
float alpha = clamp(step(0.0, health - texture(alpha_texture, UV).r * texture(under_layer_depth, under_uv_parallax).r) * top_layer_sample.a, 0.0, 1.0);
|
||||
if (alpha < 1.0 && (under_uv_parallax.x / under_layer_scale > 1.0 || under_uv_parallax.x / under_layer_scale < 0.0 || under_uv_parallax.y / under_layer_scale > 1.0 || under_uv_parallax.y / under_layer_scale < 0.0)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
ALBEDO = mix(under_layer_sample.rgb, top_layer_sample.rgb, alpha);
|
||||
NORMAL_MAP = mix(texture(under_layer_normal, under_uv_parallax).rgb, NORMAL_MAP, alpha);
|
||||
EMISSION = mix(under_layer_sample.rgb * under_emission_strength, vec3(0), alpha);
|
||||
ROUGHNESS = 0.0;
|
||||
SPECULAR = 0.0;
|
||||
METALLIC = 0.0;
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the material.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ compress/lossy_quality=0.7
|
|||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/normal_map=1
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ compress/lossy_quality=0.7
|
|||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/normal_map=1
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ compress/lossy_quality=0.7
|
|||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/normal_map=1
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue