WIP: feat(scene) integrate beauty pass — shader water, building blockouts, wind, smoke, 6 textures
- Add 3 missing Terrain3D textures: Dirt Path (id=3), Riverbank Stone (id=4), Compacted Ground (id=5) with procedural albedo PNGs + generate tool - Replace greybox river BoxMesh with animated vertex-displacement water shader - Replace greybox waterfall BoxMesh with scrolling-UV waterfall shader - Add WaterfallMist GPUParticles3D with upward drift and alpha fade - Add wind vertex shader for tree canopies (sin-based, height-weighted sway) - Replace StylizedTree.tscn with script-driven procedural tree supporting 3 canopy color variants and position-based randomization - Replace greybox house boxes with StylizedHouse (walls + pitched roof + door) - Replace mill box with StylizedMill (body + roof + water wheel cylinder) - Replace fortress box with FortressBlockout (keep + parapet + corner turret) - Replace bridge box with BridgeBlockout (deck + pillar supports) - Add ChimneySmoke GPUParticles3D on each house roof - Height-snap buildings (fortress + village) to terrain surface in _ready() - Update JajceWorld.tscn: remove all greybox landmark sub-resources, instance new scenes, keep terrain/navigation/sky/fog as-is - Update scaffold test for new scene structure and beauty elements
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
extends Node3D
|
||||
|
||||
enum CanopyVariant {
|
||||
GREEN,
|
||||
DARK_GREEN,
|
||||
YELLOW_GREEN,
|
||||
}
|
||||
|
||||
@export var canopy_variant: CanopyVariant = CanopyVariant.GREEN
|
||||
@export var canopy_radius: float = 1.35
|
||||
|
||||
const COLORS := {
|
||||
CanopyVariant.GREEN: Color(0.19, 0.38, 0.17),
|
||||
CanopyVariant.DARK_GREEN: Color(0.12, 0.30, 0.12),
|
||||
CanopyVariant.YELLOW_GREEN: Color(0.30, 0.42, 0.15),
|
||||
}
|
||||
|
||||
const WIND_SHADER := preload("res://world/jajce/materials/wind.gdshader")
|
||||
|
||||
func _ready() -> void:
|
||||
for child in get_children():
|
||||
child.queue_free()
|
||||
|
||||
var hash_seed := hash(global_position)
|
||||
var rng := RandomNumberGenerator.new()
|
||||
rng.seed = hash_seed
|
||||
canopy_variant = rng.randi() % COLORS.size() as CanopyVariant
|
||||
canopy_radius = 1.0 + rng.randf() * 0.8
|
||||
|
||||
var trunk_mesh := CylinderMesh.new()
|
||||
trunk_mesh.top_radius = 0.22
|
||||
trunk_mesh.bottom_radius = 0.32
|
||||
trunk_mesh.height = 2.8
|
||||
|
||||
var trunk_mat := StandardMaterial3D.new()
|
||||
trunk_mat.albedo_color = Color(0.27, 0.16, 0.09)
|
||||
trunk_mat.roughness = 0.95
|
||||
trunk_mesh.material = trunk_mat
|
||||
|
||||
var trunk := MeshInstance3D.new()
|
||||
trunk.mesh = trunk_mesh
|
||||
trunk.position = Vector3(0, 1.4, 0)
|
||||
add_child(trunk)
|
||||
|
||||
var canopy_mesh := SphereMesh.new()
|
||||
canopy_mesh.radius = canopy_radius
|
||||
canopy_mesh.height = 2.4
|
||||
|
||||
var canopy_mat := ShaderMaterial.new()
|
||||
canopy_mat.shader = WIND_SHADER
|
||||
canopy_mat.set_shader_parameter("albedo", COLORS[canopy_variant])
|
||||
canopy_mat.set_shader_parameter("roughness", 0.9)
|
||||
canopy_mesh.material = canopy_mat
|
||||
|
||||
var canopy := MeshInstance3D.new()
|
||||
canopy.mesh = canopy_mesh
|
||||
canopy.position = Vector3(0, 3.2 + (canopy_radius - 1.35) * 0.5, 0)
|
||||
add_child(canopy)
|
||||
Reference in New Issue
Block a user