Procedural trees demo.

This commit is contained in:
Relintai 2024-09-08 17:24:10 +02:00
parent 1cdfe1836e
commit 13c31ac83f
12 changed files with 229 additions and 0 deletions

View File

@ -0,0 +1,39 @@
[gd_scene load_steps=9 format=3]
[ext_resource path="res://floor.png" type="Texture" id=1]
[ext_resource path="res://twig.png" type="Texture" id=2]
[ext_resource path="res://bark.jpg" type="Texture" id=3]
[sub_resource type="PlaneMesh" id=1]
size = Vector2( 100, 100 )
[sub_resource type="SpatialMaterial" id=2]
albedo_texture = ExtResource( 1 )
uv1_scale = Vector3( 5, 5, 5 )
[sub_resource type="SpatialMaterial" id=5]
albedo_texture = ExtResource( 3 )
[sub_resource type="SpatialMaterial" id=4]
flags_transparent = true
albedo_texture = ExtResource( 2 )
[sub_resource type="ProceduralTreeMesh" id=3]
twig_material = SubResource( 4 )
trunk_material = SubResource( 5 )
[node name="Main" type="Spatial"]
[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.995856, 0.0909454, 0, -0.0909454, 0.995856, 0, 3.24964, 6.08982 )
[node name="Floor" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = SubResource( 2 )
[node name="Tree" type="MeshInstance" parent="."]
mesh = SubResource( 3 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.999979, -0.00633815, 0.00104455, 0.0021793, 0.487706, 0.873005, -0.00604267, -0.872985, 0.487709, 0, 12.7518, 7.74885 )
light_energy = 0.413

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/bark.jpg-db1925684069186df966c2d6a5bd27d7.s3tc.stex"
path.etc="res://.import/bark.jpg-db1925684069186df966c2d6a5bd27d7.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc" ],
"vram_texture": true
}
[deps]
source_file="res://bark.jpg"
dest_files=[ "res://.import/bark.jpg-db1925684069186df966c2d6a5bd27d7.s3tc.stex", "res://.import/bark.jpg-db1925684069186df966c2d6a5bd27d7.etc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -0,0 +1,7 @@
[gd_resource type="Environment3D" load_steps=2 format=3]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/floor.png-d43f03cb7a8f42941311ed90ed2021b9.s3tc.stex"
path.etc="res://.import/floor.png-d43f03cb7a8f42941311ed90ed2021b9.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc" ],
"vram_texture": true
}
[deps]
source_file="res://floor.png"
dest_files=[ "res://.import/floor.png-d43f03cb7a8f42941311ed90ed2021b9.s3tc.stex", "res://.import/floor.png-d43f03cb7a8f42941311ed90ed2021b9.etc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,25 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
[application]
config/name="Procedural Trees"
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
[physics]
common/enable_pause_aware_picking=true
[rendering]
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_environment="res://default_env.tres"

View File

@ -0,0 +1,12 @@
The textures are from the https://github.com/jarikomppa/proctree repository.
From the original readme:
All of the textures are CC0 / public domain material (primarily, if not completely, by nobiax.deviantart.com). The additional textures do let you make more varieties of trees though; the base package only comes with one trunk and twig texture.
Additional (not mandatory) 400 megs of trunk / twig textures
http://iki.fi/sol/zip/happytree_20150118_tex.zip
If you opt to download the additional textures, just unzip both zips in the same place. HappyTree will work without the additional textures (it'll actually be faster), so if you're just trying it out, I recommend NOT downloading the additional stuff.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 KiB

View File

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="StreamTexture"
path.s3tc="res://.import/twig.png-dfe3c857b25e019a9891469879fedf6a.s3tc.stex"
path.etc="res://.import/twig.png-dfe3c857b25e019a9891469879fedf6a.etc.stex"
metadata={
"imported_formats": [ "s3tc", "etc" ],
"vram_texture": true
}
[deps]
source_file="res://twig.png"
dest_files=[ "res://.import/twig.png-dfe3c857b25e019a9891469879fedf6a.s3tc.stex", "res://.import/twig.png-dfe3c857b25e019a9891469879fedf6a.etc.stex" ]
[params]
compress/mode=2
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=true
flags/filter=true
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0