Add shrub asset

This commit is contained in:
Karl Office 2025-10-21 16:31:46 +02:00
parent 37bcb52195
commit f4dc45b5ec
10 changed files with 233 additions and 0 deletions

44
shrub.gdshader Normal file
View File

@ -0,0 +1,44 @@
shader_type spatial;
render_mode cull_disabled;
uniform float fluff_scale = 0.2;
uniform sampler2D albedo: source_color;
uniform sampler2D normals: hint_normal;
uniform vec3 color_dark: source_color;
uniform vec3 color_light: source_color;
varying vec2 remapped_uv;
void vertex() {
remapped_uv = (UV - vec2(0.5)) * 2.0;
VERTEX += TANGENT * remapped_uv.x * fluff_scale;
VERTEX -= BINORMAL * remapped_uv.y * fluff_scale;
NORMAL = normalize(VERTEX);
}
void fragment() {
if (!FRONT_FACING) NORMAL = -NORMAL;
vec4 albedo_sample = texture(albedo, UV).rgba;
ALBEDO = mix(color_dark, color_light, length(remapped_uv));
ALPHA = albedo_sample.a;
ALPHA_SCISSOR_THRESHOLD = 0.95;
BACKLIGHT = color_light * 1.5;
ROUGHNESS = 0.4;
SPECULAR = 0.2;
AO = mix(0.5, 1.0, smoothstep(-1.0, 2.0, VERTEX.y));
AO_LIGHT_AFFECT = 0.25;
NORMAL_MAP = texture(normals, UV).xyz;
}
//void light() {
// // Called for every pixel for every light affecting the material.
// // Uncomment to replace the default light processing function with this one.
//}

1
shrub.gdshader.uid Normal file
View File

@ -0,0 +1 @@
uid://3ixnvosr8lj1

BIN
shrub.glb Normal file

Binary file not shown.

54
shrub.glb.import Normal file
View File

@ -0,0 +1,54 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bgtvxrg16qvqt"
path="res://.godot/imported/shrub.glb-04bc3328a72af467586fa057682ca97d.scn"
[deps]
source_file="res://shrub.glb"
dest_files=["res://.godot/imported/shrub.glb-04bc3328a72af467586fa057682ca97d.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={
"meshes": {
"shrub_Cube_001": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 20.0,
"save_to_file/enabled": true,
"save_to_file/fallback_path": "res://shrub.tres",
"save_to_file/path": "uid://dnbkv8y3m0v17"
}
}
}
gltf/naming_version=2
gltf/embedded_image_handling=1

BIN
shrub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 KiB

41
shrub.png.import Normal file
View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5wsyy4evhwx7"
path.s3tc="res://.godot/imported/shrub.png-49c293914b28bf242c9c13cea8dedaaf.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://shrub.png"
dest_files=["res://.godot/imported/shrub.png-49c293914b28bf242c9c13cea8dedaaf.s3tc.ctex"]
[params]
compress/mode=2
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

33
shrub.tres Normal file

File diff suppressed because one or more lines are too long

19
shrub.tscn Normal file
View File

@ -0,0 +1,19 @@
[gd_scene load_steps=6 format=3 uid="uid://cmeryb2ccwsmp"]
[ext_resource type="Shader" uid="uid://3ixnvosr8lj1" path="res://shrub.gdshader" id="1_a1m8w"]
[ext_resource type="Texture2D" uid="uid://b5wsyy4evhwx7" path="res://shrub.png" id="2_m3btl"]
[ext_resource type="Texture2D" uid="uid://dnl6mb5ixg8ow" path="res://shrub_normal.png" id="3_hecmk"]
[ext_resource type="ArrayMesh" uid="uid://dnbkv8y3m0v17" path="res://shrub.tres" id="4_l5pfm"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gbfbk"]
render_priority = 0
shader = ExtResource("1_a1m8w")
shader_parameter/fluff_scale = 1.605
shader_parameter/albedo = ExtResource("2_m3btl")
shader_parameter/normals = ExtResource("3_hecmk")
shader_parameter/color_dark = Color(0.32639998, 0.64, 0.39434668, 1)
shader_parameter/color_light = Color(0.56649995, 0.66, 0.098999985, 1)
[node name="Shrub" type="MeshInstance3D"]
material_override = SubResource("ShaderMaterial_gbfbk")
mesh = ExtResource("4_l5pfm")

BIN
shrub_normal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

41
shrub_normal.png.import Normal file
View File

@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dnl6mb5ixg8ow"
path.s3tc="res://.godot/imported/shrub_normal.png-73ba7696790d32c7780a490976206522.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://shrub_normal.png"
dest_files=["res://.godot/imported/shrub_normal.png-73ba7696790d32c7780a490976206522.s3tc.ctex"]
[params]
compress/mode=2
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=1
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