Add grass texture and soften world lighting

This commit is contained in:
Alexander Sellite 2026-07-27 03:29:35 -04:00
parent 1dabdd0d23
commit 67d17074b2
8 changed files with 98 additions and 4 deletions

View file

@ -0,0 +1,10 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3]
[ext_resource type="Texture2D" path="res://art/exported/environment/textures/grass_olive_tile.png" id="1_texture"]
[resource]
resource_name = "Starter Island Grass"
texture_filter = 4
albedo_texture = ExtResource("1_texture")
roughness = 1.0
uv1_scale = Vector3(21.406, 21.406, 21.406)

View file

@ -19,8 +19,13 @@ const FishingShopInteractionType = preload(
^"Interactables/PelicanCoolerPerch"
)
@export_group("Grass Surface")
@export var grass_material: Material
@export_range(0, 16, 1) var grass_surface_index: int = 0
func _ready() -> void:
_apply_grass_material()
_build_terrain_collision()
@ -44,6 +49,28 @@ func has_terrain_collision() -> bool:
return collision_shape != null and collision_shape.shape != null
func _apply_grass_material() -> void:
var visual_mesh: MeshInstance3D = (
get_node_or_null(visual_mesh_path) as MeshInstance3D
)
if visual_mesh == null or visual_mesh.mesh == null:
push_error("Starter island visual mesh is unavailable.")
return
if grass_material == null:
push_error("Starter island grass material is unavailable.")
return
if grass_surface_index >= visual_mesh.mesh.get_surface_count():
push_error("Starter island grass surface index is invalid.")
return
if visual_mesh.mesh.surface_get_name(grass_surface_index) != "grass":
push_error("Starter island grass surface name does not match.")
return
visual_mesh.set_surface_override_material(
grass_surface_index,
grass_material
)
func _build_terrain_collision() -> void:
var visual_mesh: MeshInstance3D = (
get_node_or_null(visual_mesh_path) as MeshInstance3D

View file

@ -8,6 +8,7 @@
[ext_resource type="Script" path="res://world/safe_respawn_point.gd" id="6_safe"]
[ext_resource type="PackedScene" path="res://world/interactables/fishing_shop_world.tscn" id="7_shop"]
[ext_resource type="PackedScene" path="res://world/interactables/pelican_buyer_world.tscn" id="8_pelican"]
[ext_resource type="Material" path="res://world/materials/starter_island_grass.tres" id="9_grass"]
[sub_resource type="StandardMaterial3D" id="WaterMaterial"]
transparency = 1
@ -46,6 +47,7 @@ size = Vector3(11.5, 4.8, 8.5)
[node name="StarterIslandRegion" type="Node3D"]
script = ExtResource("1_region")
grass_material = ExtResource("9_grass")
region_id = &"starter_island"
[node name="Visuals" type="Node3D" parent="."]

View file

@ -6,10 +6,21 @@
[sub_resource type="Environment" id="Environment"]
background_mode = 1
background_color = Color(0.48, 0.74, 0.92, 1)
background_color = Color(0.58, 0.72, 0.82, 1)
background_energy_multiplier = 0.85
ambient_light_source = 3
ambient_light_color = Color(0.72, 0.78, 0.84, 1)
ambient_light_energy = 0.72
ambient_light_color = Color(0.78, 0.84, 0.92, 1)
ambient_light_energy = 0.95
fog_enabled = true
fog_light_color = Color(0.62, 0.73, 0.8, 1)
fog_light_energy = 0.75
fog_density = 0.0025
fog_aerial_perspective = 0.2
fog_sky_affect = 0.15
adjustment_enabled = true
adjustment_brightness = 0.9
adjustment_contrast = 0.89
adjustment_saturation = 0.91
[sub_resource type="BoxShape3D" id="NorthSouthBoundsShape"]
size = Vector3(120, 14, 2)
@ -30,8 +41,11 @@ environment = SubResource("Environment")
[node name="Sun" type="DirectionalLight3D" parent="Environment"]
rotation_degrees = Vector3(-54, -32, 0)
light_energy = 1.1
light_color = Color(1, 0.94, 0.88, 1)
light_energy = 0.68
shadow_enabled = true
shadow_opacity = 0.58
shadow_blur = 2.0
[node name="Regions" type="Node3D" parent="."]