diff --git a/art/exported/environment/textures/grass_olive_tile.png b/art/exported/environment/textures/grass_olive_tile.png new file mode 100644 index 0000000..affb5dc Binary files /dev/null and b/art/exported/environment/textures/grass_olive_tile.png differ diff --git a/art/exported/environment/textures/grass_olive_tile.png.import b/art/exported/environment/textures/grass_olive_tile.png.import new file mode 100644 index 0000000..bd6ee69 --- /dev/null +++ b/art/exported/environment/textures/grass_olive_tile.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btxhq3rdlum2" +path.s3tc="res://.godot/imported/grass_olive_tile.png-72072a382d0948818df97773afa5493f.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://art/exported/environment/textures/grass_olive_tile.png" +dest_files=["res://.godot/imported/grass_olive_tile.png-72072a382d0948818df97773afa5493f.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 diff --git a/art/source/environment/textures/.gdignore b/art/source/environment/textures/.gdignore new file mode 100644 index 0000000..e69de29 diff --git a/art/source/environment/textures/grass_olive_tile.xcf b/art/source/environment/textures/grass_olive_tile.xcf new file mode 100644 index 0000000..d81b02d Binary files /dev/null and b/art/source/environment/textures/grass_olive_tile.xcf differ diff --git a/world/materials/starter_island_grass.tres b/world/materials/starter_island_grass.tres new file mode 100644 index 0000000..2c0ec07 --- /dev/null +++ b/world/materials/starter_island_grass.tres @@ -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) diff --git a/world/regions/starter_island_region.gd b/world/regions/starter_island_region.gd index 5e35493..9392164 100644 --- a/world/regions/starter_island_region.gd +++ b/world/regions/starter_island_region.gd @@ -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 diff --git a/world/regions/starter_island_region.tscn b/world/regions/starter_island_region.tscn index f2b1d6e..ff2bd24 100644 --- a/world/regions/starter_island_region.tscn +++ b/world/regions/starter_island_region.tscn @@ -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="."] diff --git a/world/test_world.tscn b/world/test_world.tscn index b5d4f20..75bd759 100644 --- a/world/test_world.tscn +++ b/world/test_world.tscn @@ -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="."]