some small grass and shader test

This commit is contained in:
2026-01-08 14:55:29 +01:00
commit 26a3eadbc3
31 changed files with 11457 additions and 0 deletions

BIN
grass/High/High Grass.c4d Normal file

Binary file not shown.

BIN
grass/High/High Grass.fbx Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bvq7n1s5iasky"
path="res://.godot/imported/High Grass.fbx-3c8a6fd67d562bd1df777a9008a5f9a8.scn"
[deps]
source_file="res://grass/High/High Grass.fbx"
dest_files=["res://.godot/imported/High Grass.fbx-3c8a6fd67d562bd1df777a9008a5f9a8.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=true
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=true
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={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

8336
grass/High/High Grass.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
[remap]
importer="wavefront_obj"
importer_version=1
type="Mesh"
uid="uid://3vena5emwf0c"
path="res://.godot/imported/High Grass.obj-89e95bb964e3b3822f3d741785de1654.mesh"
[deps]
files=["res://.godot/imported/High Grass.obj-89e95bb964e3b3822f3d741785de1654.mesh"]
source_file="res://grass/High/High Grass.obj"
dest_files=["res://.godot/imported/High Grass.obj-89e95bb964e3b3822f3d741785de1654.mesh", "res://.godot/imported/High Grass.obj-89e95bb964e3b3822f3d741785de1654.mesh"]
[params]
generate_tangents=true
generate_lods=true
generate_shadow_mesh=true
generate_lightmap_uv2=false
generate_lightmap_uv2_texel_size=0.2
scale_mesh=Vector3(1, 1, 1)
offset_mesh=Vector3(0, 0, 0)
force_disable_mesh_compression=false

BIN
grass/High/High quality.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2067p8erljsx"
path="res://.godot/imported/High quality.png-f2cbe3b2baa7c6630a6e8ab7aaec3266.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://grass/High/High quality.png"
dest_files=["res://.godot/imported/High quality.png-f2cbe3b2baa7c6630a6e8ab7aaec3266.ctex"]
[params]
compress/mode=0
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=false
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=1

BIN
grass/Low/Low Grass.c4d Normal file

Binary file not shown.

BIN
grass/Low/Low Grass.fbx Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bkesb12sqs1i0"
path="res://.godot/imported/Low Grass.fbx-ab3061aea7152cd1e7988c7f9608b34a.scn"
[deps]
source_file="res://grass/Low/Low Grass.fbx"
dest_files=["res://.godot/imported/Low Grass.fbx-ab3061aea7152cd1e7988c7f9608b34a.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=true
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=true
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={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

2536
grass/Low/Low Grass.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
[remap]
importer="wavefront_obj"
importer_version=1
type="Mesh"
uid="uid://brk30gx7u0ikf"
path="res://.godot/imported/Low Grass.obj-d0afb144fcbe555363ab892cce046a84.mesh"
[deps]
files=["res://.godot/imported/Low Grass.obj-d0afb144fcbe555363ab892cce046a84.mesh"]
source_file="res://grass/Low/Low Grass.obj"
dest_files=["res://.godot/imported/Low Grass.obj-d0afb144fcbe555363ab892cce046a84.mesh", "res://.godot/imported/Low Grass.obj-d0afb144fcbe555363ab892cce046a84.mesh"]
[params]
generate_tangents=true
generate_lods=true
generate_shadow_mesh=true
generate_lightmap_uv2=false
generate_lightmap_uv2_texel_size=0.2
scale_mesh=Vector3(1, 1, 1)
offset_mesh=Vector3(0, 0, 0)
force_disable_mesh_compression=false

BIN
grass/Low/Low quality.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnhth712dv3ia"
path="res://.godot/imported/Low quality.png-843d16f764da2059ebbffc4e9ca4174c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://grass/Low/Low quality.png"
dest_files=["res://.godot/imported/Low quality.png-843d16f764da2059ebbffc4e9ca4174c.ctex"]
[params]
compress/mode=0
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=false
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=1

BIN
grass/Low/Stem.fbx Normal file

Binary file not shown.

44
grass/Low/Stem.fbx.import Normal file
View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dm7po7cjvio0r"
path="res://.godot/imported/Stem.fbx-64e2d4783dcc9e77c21f9ebc51092610.scn"
[deps]
source_file="res://grass/Low/Stem.fbx"
dest_files=["res://.godot/imported/Stem.fbx-64e2d4783dcc9e77c21f9ebc51092610.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=true
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=true
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={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
grass/Tex/Grass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c72mplm41yd06"
path="res://.godot/imported/Grass.png-31e96299899b34c09c06a37ac0cd98de.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://grass/Tex/Grass.png"
dest_files=["res://.godot/imported/Grass.png-31e96299899b34c09c06a37ac0cd98de.ctex"]
[params]
compress/mode=0
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=false
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=1

38
grass/grass.gdshader Normal file
View File

@@ -0,0 +1,38 @@
shader_type spatial;
render_mode cull_disabled;
uniform vec3 color: source_color;
uniform vec3 shade: source_color;
uniform sampler2D noise: source_color;
uniform float noiseScale = 1.0;
uniform float windSpeedScale = 1.0;
uniform float windVertexOffsetScale = 1.0;
varying vec3 worldPos;
varying vec3 instance_origin;
void vertex() {
worldPos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
instance_origin = MODELVIEW_MATRIX[3].xyz;
vec2 timeOffset = vec2(TIME/windSpeedScale);
float noiseLevel = texture(noise, timeOffset + worldPos.xz/noiseScale).r;
float vertexWindOffset = noiseLevel * worldPos.y * windVertexOffsetScale;
VERTEX += vec3(1.0, 0.0, 1.0)*vertexWindOffset;
// billboarding
// MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0],INV_VIEW_MATRIX[1],INV_VIEW_MATRIX[2],MODEL_MATRIX[3]);
}
void fragment() {
vec2 timeOffset = vec2(TIME/windSpeedScale);
float noiseLevel = texture(noise, timeOffset + worldPos.xz/noiseScale).r;
NORMAL = (VIEW_MATRIX * vec4(0.0, 1.0, 0.0, 0.0)).xyz;
ALBEDO = mix(color, shade, UV.y) * mix(color, shade, noiseLevel);
LIGHT_VERTEX = instance_origin;
}
void light() {
float lambert = clamp(dot(NORMAL, LIGHT), 0.0, 1.0);
float halfLambert = pow(lambert*0.5 + 0.5, 5);
DIFFUSE_LIGHT += halfLambert * ATTENUATION * LIGHT_COLOR / PI;
}

1
grass/grass.gdshader.uid Normal file
View File

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

20
grass/m_grass.tres Normal file
View File

@@ -0,0 +1,20 @@
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://bpfgcchpiq8wr"]
[ext_resource type="Shader" uid="uid://dkvxju1uruobh" path="res://grass/grass.gdshader" id="1_1atig"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_1atig"]
domain_warp_amplitude = 110.655
domain_warp_frequency = 0.045
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_wnfha"]
noise = SubResource("FastNoiseLite_1atig")
[resource]
render_priority = 0
shader = ExtResource("1_1atig")
shader_parameter/color = Color(0, 0.7518667, 0, 1)
shader_parameter/shade = Color(0, 0.54901963, 0.34901962, 1)
shader_parameter/noise = SubResource("NoiseTexture2D_wnfha")
shader_parameter/noiseScale = 78.52
shader_parameter/windSpeedScale = 100.0
shader_parameter/windVertexOffsetScale = 0.126