mirror of
https://github.com/MMqd/godot-nishita-sky-with-volumetric-clouds.git
synced 2024-12-23 00:17:30 +08:00
a86eb99df7
* Added a realistically lit moon influenced by the sun, resulting in different moon phases, including Earth blocking moon (new moon phase, and blood moon). * Moving camera very high on the Y axis, or changing the `Height` parameter brings the moon closer # Misc * Added support for moon and ground texture, accurate textures included. * Moving the camera on the X and Z axis (very far) changes the sky and ground texture position. * Cloud coverage now affects the brightness of the sky and sun. # Regression * Issues with cloud alpha at edges at high sun brightness, currently cutting out the sun from the clouds
23 lines
595 B
GDScript
23 lines
595 B
GDScript
extends Label
|
|
|
|
|
|
func _ready():
|
|
$"/root/Main/Camera3D".position.y = (
|
|
pow($"%HeightSlider".value, 4.0)
|
|
- $"/root/Main/WorldEnvironment".environment.sky.sky_material.get_shader_parameter("Height")
|
|
+ 1.0
|
|
)
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
set_text("FPS: " + str(Engine.get_frames_per_second()))
|
|
get_node("/root/Main/Moon Holder/Moon").transform.rotated(Vector3.UP, delta)
|
|
|
|
|
|
func _on_height_slider_value_changed(value):
|
|
$"/root/Main/Camera3D".position.y = (
|
|
pow(value, 4.0)
|
|
- $"/root/Main/WorldEnvironment".environment.sky.sky_material.get_shader_parameter("Height")
|
|
+ 1.0
|
|
)
|