Remove unused folder
@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2024 Ronny Mühle (Platinguin)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
@ -1,22 +0,0 @@
|
|||||||
# Godot-Cloud-Worlds
|
|
||||||
|
|
||||||
This is more or less a prototype to see if its possible to implement volumetric clouds which can be reached by the player. These clouds are not production ready.
|
|
||||||
|
|
||||||
The project was created with Godot 4.2.2 win64
|
|
||||||
|
|
||||||
Technical Details:
|
|
||||||
|
|
||||||
The clouds are generated via a pre-baked SDF texture. This ensures good performance, as the raymarch loop knows exactly how far it has to step to reach the clouds. As soon as the raymarcher hits the cloud surface, it goes into a fixed step sampling mode to sample the volume texture.
|
|
||||||
The lighting is calculated afterwards. There is only one light-march loop per pixel. Normally you would have to calculate the light at every step within the cloud, but the visual difference is minimal and it saves performance. The light-march steps are using the same sdf texture to determine how far they have to march. (the steps are not in a fixed size) They are also reduced over distance to save performance.
|
|
||||||
|
|
||||||
Known Issues:
|
|
||||||
- To see the clouds in the editor, you have to increase the camera z-clipping plane
|
|
||||||
- The clouds can't generate cubemap reflections (to make this work they have to be rendered differently as a sky shader to generate a radiance map)
|
|
||||||
- The clouds can't generate shadows to affect other objects in the scene
|
|
||||||
- The clouds cause sorting issues with other alpha blended materials (as they are rendered as post-effect)
|
|
||||||
|
|
||||||
Feel free to edit them or use the code in your own Godot project.
|
|
||||||
|
|
||||||
Future Ideas:
|
|
||||||
|
|
||||||
Most likely I will use this tech to create a skybox baker to make the clouds static, but as cheap as they can get with highest quality looks. So you could have a semi-realtime sky with clouds which are generated via GPU in the background. In the end they would be as cheap as a standard HDRI skybox, but you would still have the customizablity of a dynamic sky. (it would however take like a second to generate this one, so it's not realtime)
|
|
@ -1 +0,0 @@
|
|||||||
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>
|
|
Before Width: | Height: | Size: 950 B |
@ -1,38 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://6gc3033y8tar"
|
|
||||||
path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"
|
|
||||||
metadata={
|
|
||||||
"imported_formats": ["s3tc_bptc"],
|
|
||||||
"vram_texture": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://icon.svg"
|
|
||||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=2
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
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/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
|
|
||||||
svg/scale=1.0
|
|
||||||
editor/scale_with_editor_scale=false
|
|
||||||
editor/convert_colors_with_editor_theme=false
|
|
@ -1,126 +0,0 @@
|
|||||||
; 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=5
|
|
||||||
|
|
||||||
[application]
|
|
||||||
|
|
||||||
config/name="Godot - Cloud Worlds"
|
|
||||||
run/main_scene="res://scenes/basic/main.tscn"
|
|
||||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
|
||||||
config/icon="res://icon.svg"
|
|
||||||
|
|
||||||
[display]
|
|
||||||
|
|
||||||
window/vsync/vsync_mode=0
|
|
||||||
|
|
||||||
[input]
|
|
||||||
|
|
||||||
keyboard_right={
|
|
||||||
"deadzone": 0.5,
|
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
keyboard_left={
|
|
||||||
"deadzone": 0.5,
|
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
keyboard_forward={
|
|
||||||
"deadzone": 0.5,
|
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
keyboard_back={
|
|
||||||
"deadzone": 0.5,
|
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
hide_menu={
|
|
||||||
"deadzone": 0.5,
|
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"echo":false,"script":null)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
[rendering]
|
|
||||||
|
|
||||||
lights_and_shadows/directional_shadow/soft_shadow_filter_quality=5
|
|
||||||
textures/default_filters/anisotropic_filtering_level=0
|
|
||||||
anti_aliasing/quality/use_taa=true
|
|
||||||
occlusion_culling/use_occlusion_culling=true
|
|
||||||
|
|
||||||
[shader_globals]
|
|
||||||
|
|
||||||
cloud_base_texture={
|
|
||||||
"type": "sampler3D",
|
|
||||||
"value": "res://textures/clouds/cloud_sdf_base.exr"
|
|
||||||
}
|
|
||||||
cloud_detail_texture={
|
|
||||||
"type": "sampler3D",
|
|
||||||
"value": "res://textures/clouds/cloud_sdf_detail.exr"
|
|
||||||
}
|
|
||||||
cloud_base_height={
|
|
||||||
"type": "float",
|
|
||||||
"value": 1000.0
|
|
||||||
}
|
|
||||||
cloud_base_scale={
|
|
||||||
"type": "float",
|
|
||||||
"value": 1000.0
|
|
||||||
}
|
|
||||||
cloud_detail_scale={
|
|
||||||
"type": "float",
|
|
||||||
"value": 420.0
|
|
||||||
}
|
|
||||||
cloud_detail_amount={
|
|
||||||
"type": "float",
|
|
||||||
"value": 0.5
|
|
||||||
}
|
|
||||||
cloud_detail_dist={
|
|
||||||
"type": "float",
|
|
||||||
"value": 10.0
|
|
||||||
}
|
|
||||||
cloud_volume_scale={
|
|
||||||
"type": "float",
|
|
||||||
"value": 150.0
|
|
||||||
}
|
|
||||||
cloud_volume_density_low={
|
|
||||||
"type": "float",
|
|
||||||
"value": 4.0
|
|
||||||
}
|
|
||||||
cloud_volume_density_high={
|
|
||||||
"type": "float",
|
|
||||||
"value": 10.0
|
|
||||||
}
|
|
||||||
wind_vector={
|
|
||||||
"type": "vec2",
|
|
||||||
"value": Vector2(1, 0)
|
|
||||||
}
|
|
||||||
sun_light_direction={
|
|
||||||
"type": "vec3",
|
|
||||||
"value": Vector3(0, 0, 0)
|
|
||||||
}
|
|
||||||
sun_light_color={
|
|
||||||
"type": "vec3",
|
|
||||||
"value": Vector3(0, 0, 0)
|
|
||||||
}
|
|
||||||
sun_light_energy={
|
|
||||||
"type": "float",
|
|
||||||
"value": 0.3
|
|
||||||
}
|
|
||||||
cloud_volume_texture={
|
|
||||||
"type": "sampler3D",
|
|
||||||
"value": "res://textures/clouds/cloud_volume_a.png"
|
|
||||||
}
|
|
||||||
wind_uplift={
|
|
||||||
"type": "float",
|
|
||||||
"value": 2.0
|
|
||||||
}
|
|
||||||
cloud_base_squeeze={
|
|
||||||
"type": "float",
|
|
||||||
"value": 0.5
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
extends Camera3D
|
|
||||||
|
|
||||||
var camera_movement_speed : float = 100.0
|
|
||||||
var camera_rotation_speed : float = 0.005
|
|
||||||
|
|
||||||
func _process(delta):
|
|
||||||
if Input.is_action_pressed("keyboard_right"):
|
|
||||||
self.transform.origin += self.transform.basis.x * Input.get_action_strength("keyboard_right") * delta * camera_movement_speed
|
|
||||||
if Input.is_action_pressed("keyboard_left"):
|
|
||||||
self.transform.origin -= self.transform.basis.x * Input.get_action_strength("keyboard_left") * delta * camera_movement_speed
|
|
||||||
if Input.is_action_pressed("keyboard_forward"):
|
|
||||||
self.transform.origin -= self.transform.basis.z * Input.get_action_strength("keyboard_forward") * delta * camera_movement_speed
|
|
||||||
if Input.is_action_pressed("keyboard_back"):
|
|
||||||
self.transform.origin += self.transform.basis.z * Input.get_action_strength("keyboard_back") * delta * camera_movement_speed
|
|
||||||
|
|
||||||
func _input(event):
|
|
||||||
# RIGHT MOUSE CLICK
|
|
||||||
if (event is InputEventMouseMotion and event.button_mask == 2):
|
|
||||||
self.look_at(self.transform.origin - self.transform.basis.z + self.transform.basis.x * camera_rotation_speed * event.relative.x - self.transform.basis.y * camera_rotation_speed * event.relative.y)
|
|
||||||
# MOUSE WHEEL UP + RIGHT MOUSE CLICK (8+2)
|
|
||||||
if (event is InputEventMouseButton and event.button_mask == 10):
|
|
||||||
camera_movement_speed *= 1.1
|
|
||||||
# MOUSE WHEEL DOWN+ RIGHT MOUSE CLICK (16+2)
|
|
||||||
if (event is InputEventMouseButton and event.button_mask == 18):
|
|
||||||
camera_movement_speed *= 0.9
|
|
||||||
if camera_movement_speed < 1.0:
|
|
||||||
camera_movement_speed = 1.0
|
|
@ -1,9 +0,0 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://croxc3ih02m6b"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scenes/basic/camera.gd" id="1_oyymy"]
|
|
||||||
|
|
||||||
[node name="camera" type="Camera3D"]
|
|
||||||
current = true
|
|
||||||
near = 0.01
|
|
||||||
far = 20000.0
|
|
||||||
script = ExtResource("1_oyymy")
|
|
@ -1,5 +0,0 @@
|
|||||||
extends Label
|
|
||||||
|
|
||||||
func _process(delta):
|
|
||||||
var debug_string : String = "FPS = " + str(Engine.get_frames_per_second()) + "\n"
|
|
||||||
set_text(debug_string)
|
|
@ -1,95 +0,0 @@
|
|||||||
[gd_scene load_steps=17 format=3 uid="uid://o30gir8h2ufu"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scenes/basic/debug.gd" id="2_3sqim"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://djl3q6ynbkau0" path="res://scenes/world/clouds.tscn" id="2_38qtq"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://croxc3ih02m6b" path="res://scenes/basic/camera.tscn" id="2_ew6s1"]
|
|
||||||
[ext_resource type="CompressedTexture3D" uid="uid://bwvwaoihjy78g" path="res://textures/clouds/cloud_sdf_base.exr" id="3_xqfxp"]
|
|
||||||
[ext_resource type="CompressedTexture3D" uid="uid://437feiv1oerc" path="res://textures/clouds/cloud_sdf_detail.exr" id="4_6liwh"]
|
|
||||||
[ext_resource type="Script" path="res://scenes/basic/sunlight.gd" id="4_uk33e"]
|
|
||||||
[ext_resource type="CompressedTexture3D" uid="uid://4ncscg8jgec0" path="res://textures/clouds/cloud_volume_a.png" id="5_1gko6"]
|
|
||||||
[ext_resource type="Gradient" uid="uid://cwiiu5dy83cai" path="res://textures/gradients/color_gradient_a.tres" id="5_3hakk"]
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_7bm1i"]
|
|
||||||
gradient = ExtResource("5_3hakk")
|
|
||||||
width = 256
|
|
||||||
height = 10
|
|
||||||
|
|
||||||
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_c28mf"]
|
|
||||||
mie_color = Color(1, 0.811765, 0.552941, 1)
|
|
||||||
use_debanding = false
|
|
||||||
|
|
||||||
[sub_resource type="Sky" id="Sky_dolyt"]
|
|
||||||
sky_material = SubResource("PhysicalSkyMaterial_c28mf")
|
|
||||||
|
|
||||||
[sub_resource type="Environment" id="Environment_288wc"]
|
|
||||||
background_mode = 2
|
|
||||||
sky = SubResource("Sky_dolyt")
|
|
||||||
tonemap_mode = 3
|
|
||||||
ssao_enabled = true
|
|
||||||
ssil_enabled = true
|
|
||||||
volumetric_fog_anisotropy = 0.9
|
|
||||||
volumetric_fog_length = 256.0
|
|
||||||
volumetric_fog_ambient_inject = 10.0
|
|
||||||
adjustment_saturation = 0.3
|
|
||||||
adjustment_color_correction = SubResource("GradientTexture2D_7bm1i")
|
|
||||||
|
|
||||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_vf470"]
|
|
||||||
auto_exposure_enabled = true
|
|
||||||
auto_exposure_scale = 0.3
|
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bfr7x"]
|
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_avnke"]
|
|
||||||
|
|
||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_e0aqa"]
|
|
||||||
size = Vector2(10, 10)
|
|
||||||
|
|
||||||
[node name="main" type="Node"]
|
|
||||||
|
|
||||||
[node name="camera" parent="." instance=ExtResource("2_ew6s1")]
|
|
||||||
|
|
||||||
[node name="clouds" parent="." node_paths=PackedStringArray("world_environment", "directional_light", "camera") instance=ExtResource("2_38qtq")]
|
|
||||||
world_environment = NodePath("../WorldEnvironment")
|
|
||||||
directional_light = NodePath("../sunlight")
|
|
||||||
camera = NodePath("../camera")
|
|
||||||
cloud_base_texture = ExtResource("3_xqfxp")
|
|
||||||
cloud_detail_texture = ExtResource("4_6liwh")
|
|
||||||
cloud_volume_texture = ExtResource("5_1gko6")
|
|
||||||
wind_vector = Vector2(2, 0)
|
|
||||||
wind_uplift = 3.0
|
|
||||||
|
|
||||||
[node name="debug" type="Label" parent="."]
|
|
||||||
anchors_preset = 1
|
|
||||||
anchor_left = 1.0
|
|
||||||
anchor_right = 1.0
|
|
||||||
offset_left = -225.0
|
|
||||||
offset_top = 11.0
|
|
||||||
offset_right = -14.0
|
|
||||||
offset_bottom = 378.0
|
|
||||||
grow_horizontal = 0
|
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
|
||||||
text = "FPS = 100"
|
|
||||||
horizontal_alignment = 2
|
|
||||||
script = ExtResource("2_3sqim")
|
|
||||||
|
|
||||||
[node name="sunlight" type="DirectionalLight3D" parent="."]
|
|
||||||
transform = Transform3D(0.682387, -0.466591, 0.562709, -0.397852, 0.408724, 0.821376, -0.613239, -0.784371, 0.0932734, 0, 0, 0)
|
|
||||||
rotation_edit_mode = 2
|
|
||||||
light_color = Color(1, 0.811765, 0.552941, 1)
|
|
||||||
light_energy = 0.3
|
|
||||||
light_angular_distance = 1.0
|
|
||||||
shadow_enabled = true
|
|
||||||
directional_shadow_blend_splits = true
|
|
||||||
script = ExtResource("4_uk33e")
|
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
||||||
environment = SubResource("Environment_288wc")
|
|
||||||
camera_attributes = SubResource("CameraAttributesPractical_vf470")
|
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
|
||||||
material_override = SubResource("StandardMaterial3D_bfr7x")
|
|
||||||
mesh = SubResource("SphereMesh_avnke")
|
|
||||||
|
|
||||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
|
||||||
mesh = SubResource("PlaneMesh_e0aqa")
|
|
@ -1,9 +0,0 @@
|
|||||||
extends DirectionalLight3D
|
|
||||||
|
|
||||||
var a : float = 0.0;
|
|
||||||
|
|
||||||
func _process(delta):
|
|
||||||
a += 0.001 # Dynamic
|
|
||||||
a = 2.5 # Static Position
|
|
||||||
|
|
||||||
self.look_at( transform.origin - Vector3(sin(a * 0.51), sin(a) * 0.5 + 0.52, cos(a * 0.51)) )
|
|
@ -1,228 +0,0 @@
|
|||||||
@tool
|
|
||||||
|
|
||||||
extends Node
|
|
||||||
|
|
||||||
@export_subgroup("Dependencies")
|
|
||||||
@export var world_environment : WorldEnvironment
|
|
||||||
@export var directional_light : DirectionalLight3D
|
|
||||||
@export var camera : Camera3D
|
|
||||||
|
|
||||||
@export_subgroup("Textures")
|
|
||||||
@export var cloud_base_texture : Texture3D:
|
|
||||||
set(new_value):
|
|
||||||
cloud_base_texture = new_value
|
|
||||||
update_cloud_textures()
|
|
||||||
@export var cloud_detail_texture : Texture3D:
|
|
||||||
set(new_value):
|
|
||||||
cloud_detail_texture = new_value
|
|
||||||
update_cloud_textures()
|
|
||||||
@export var cloud_volume_texture : Texture3D:
|
|
||||||
set(new_value):
|
|
||||||
cloud_volume_texture = new_value
|
|
||||||
update_cloud_textures()
|
|
||||||
|
|
||||||
@export_subgroup("Wind")
|
|
||||||
@export var wind_vector : Vector2 = Vector2(1.0, 0.0):
|
|
||||||
set(new_value):
|
|
||||||
wind_vector = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var wind_uplift : float = 2.0:
|
|
||||||
set(new_value):
|
|
||||||
wind_uplift = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
|
|
||||||
@export_subgroup("Cloud Shape")
|
|
||||||
@export var cloud_base_height : float = 1000.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_base_height = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_base_scale : float = 2000.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_base_scale = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_base_squeeze : float = 0.5:
|
|
||||||
set(new_value):
|
|
||||||
cloud_base_squeeze = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_detail_scale : float = 420.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_detail_scale = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_detail_amount : float = 0.5:
|
|
||||||
set(new_value):
|
|
||||||
cloud_detail_amount = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_detail_dist : float = 10.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_detail_dist = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_volume_scale : float = 150.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_volume_scale = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_volume_density_low : float = 4.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_volume_density_low = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
@export var cloud_volume_density_high : float = 10.0:
|
|
||||||
set(new_value):
|
|
||||||
cloud_volume_density_high = new_value
|
|
||||||
update_cloud_globals()
|
|
||||||
|
|
||||||
@export_subgroup("Cloud Rendering")
|
|
||||||
@export var render_normal_offset : float = 7.0:
|
|
||||||
set(new_value):
|
|
||||||
render_normal_offset = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_normal_blur : float = 10.0:
|
|
||||||
set(new_value):
|
|
||||||
render_normal_blur = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_ao_amount : float = 2.0:
|
|
||||||
set(new_value):
|
|
||||||
render_ao_amount = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_hg_base : float = 0.7:
|
|
||||||
set(new_value):
|
|
||||||
render_hg_base = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_hg_amount : float = 0.5:
|
|
||||||
set(new_value):
|
|
||||||
render_hg_amount = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_hg_mask : float = 0.05:
|
|
||||||
set(new_value):
|
|
||||||
render_hg_mask = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_hg_color_saturation : float = 1.0:
|
|
||||||
set(new_value):
|
|
||||||
render_hg_color_saturation = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_hg_color_power : float = 0.2:
|
|
||||||
set(new_value):
|
|
||||||
render_hg_color_power = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_sky_color_saturation : float = 1.0:
|
|
||||||
set(new_value):
|
|
||||||
render_sky_color_saturation = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_direct_shadow_ramp_dist : float = 1000.0:
|
|
||||||
set(new_value):
|
|
||||||
render_direct_shadow_ramp_dist = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_direct_shadow_jitter : float = 0.05:
|
|
||||||
set(new_value):
|
|
||||||
render_direct_shadow_jitter = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_short_shadow_amount : float = 0.1:
|
|
||||||
set(new_value):
|
|
||||||
render_short_shadow_amount = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_short_shadow_dist : float = 70.0:
|
|
||||||
set(new_value):
|
|
||||||
render_short_shadow_dist = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_smooth_shadow_offset : float = 150.0:
|
|
||||||
set(new_value):
|
|
||||||
render_smooth_shadow_offset = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_smooth_shadow_bias : float = 100.0:
|
|
||||||
set(new_value):
|
|
||||||
render_smooth_shadow_bias = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
@export var render_smooth_shadow_amount : float = 1.0:
|
|
||||||
set(new_value):
|
|
||||||
render_smooth_shadow_amount = new_value
|
|
||||||
update_cloud_shader()
|
|
||||||
|
|
||||||
func update_cloud_textures():
|
|
||||||
# Set Global Texture Variables
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_base_texture", cloud_base_texture)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_detail_texture", cloud_detail_texture)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_volume_texture", cloud_volume_texture)
|
|
||||||
|
|
||||||
func update_cloud_globals():
|
|
||||||
# OUTPUT SETTINGS
|
|
||||||
#print( ProjectSettings.get_setting("shader_globals/cloud_base_height") )
|
|
||||||
# Set Global Variables In Editor Settings (Not Needed)
|
|
||||||
#if Engine.is_editor_hint():
|
|
||||||
# ProjectSettings.set_setting("shader_globals/cloud_base_height", cloud_base_height)
|
|
||||||
|
|
||||||
# Set Global Shape Variables
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_base_height", cloud_base_height)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_base_scale", cloud_base_scale)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_base_squeeze", cloud_base_squeeze)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_detail_scale", cloud_detail_scale)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_detail_amount", cloud_detail_amount)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_detail_dist", cloud_detail_dist)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_volume_scale", cloud_volume_scale)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_volume_density_low", cloud_volume_density_low)
|
|
||||||
RenderingServer.global_shader_parameter_set("cloud_volume_density_high", cloud_volume_density_high)
|
|
||||||
# Set Global Wind Variables
|
|
||||||
RenderingServer.global_shader_parameter_set("wind_vector", wind_vector)
|
|
||||||
RenderingServer.global_shader_parameter_set("wind_uplift", wind_uplift)
|
|
||||||
|
|
||||||
func update_cloud_shader():
|
|
||||||
$clouds.material_override.set_shader_parameter("render_normal_offset", render_normal_offset)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_normal_blur", render_normal_blur)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_ao_amount", render_ao_amount)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_hg_base", render_hg_base)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_hg_amount", render_hg_amount)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_hg_mask", render_hg_mask)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_hg_color_saturation", render_hg_color_saturation)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_hg_color_power", render_hg_color_power)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_sky_color_saturation", render_sky_color_saturation)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_direct_shadow_ramp_dist", render_direct_shadow_ramp_dist)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_direct_shadow_jitter", render_direct_shadow_jitter)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_short_shadow_amount", render_short_shadow_amount)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_short_shadow_dist", render_short_shadow_dist)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_smooth_shadow_offset", render_smooth_shadow_offset)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_smooth_shadow_bias", render_smooth_shadow_bias)
|
|
||||||
$clouds.material_override.set_shader_parameter("render_smooth_shadow_amount", render_smooth_shadow_amount)
|
|
||||||
|
|
||||||
func update_world_environment():
|
|
||||||
if !world_environment:
|
|
||||||
printerr("Error! Clouds need to be linked to a WorldEnvironment node")
|
|
||||||
else:
|
|
||||||
# Get Sky-Material From WorldEnvironment Node
|
|
||||||
var sky_material := world_environment.environment.sky.get_material()
|
|
||||||
# Sync All Variables To Sky Buffer
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("rayleigh", sky_material.rayleigh_coefficient )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("rayleigh_color", sky_material.rayleigh_color )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("mie", sky_material.mie_coefficient )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("mie_eccentricity", sky_material.mie_eccentricity )
|
|
||||||
sky_material.mie_color = directional_light.light_color
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("mie_color", sky_material.mie_color )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("turbidity", sky_material.turbidity )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("sun_disk_scale", sky_material.sun_disk_scale )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("ground_color", sky_material.ground_color )
|
|
||||||
$buffer_sky/sky.material_override.set_shader_parameter("exposure", sky_material.energy_multiplier )
|
|
||||||
|
|
||||||
func update_directional_light():
|
|
||||||
if !directional_light:
|
|
||||||
printerr("Error! Clouds need to be linked to a DirectionalLight3D node")
|
|
||||||
else:
|
|
||||||
var light_direction : Vector3 = directional_light.transform.basis.z.normalized()
|
|
||||||
# Update Global Shader Variables - Sun Light
|
|
||||||
RenderingServer.global_shader_parameter_set("sun_light_direction", light_direction)
|
|
||||||
RenderingServer.global_shader_parameter_set("sun_light_energy", directional_light.light_energy)
|
|
||||||
RenderingServer.global_shader_parameter_set("sun_light_color", directional_light.light_color)
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
$buffer_sky.size = $buffer_sky.size
|
|
||||||
$clouds.show()
|
|
||||||
update_cloud_globals()
|
|
||||||
update_cloud_shader()
|
|
||||||
update_cloud_textures()
|
|
||||||
|
|
||||||
func update_cloud_positions():
|
|
||||||
if !camera:
|
|
||||||
printerr("Error! Clouds need to be linked to a Camera3D node")
|
|
||||||
else:
|
|
||||||
$clouds.transform.origin = camera.transform.origin
|
|
||||||
|
|
||||||
@warning_ignore("unused_parameter")
|
|
||||||
func _process(delta):
|
|
||||||
update_cloud_positions()
|
|
||||||
update_directional_light()
|
|
||||||
update_world_environment()
|
|
@ -1,88 +0,0 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://djl3q6ynbkau0"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scenes/world/clouds.gd" id="1_artgg"]
|
|
||||||
[ext_resource type="Shader" path="res://shaders/cloud_sdf.gdshader" id="3_p8xnm"]
|
|
||||||
[ext_resource type="Shader" path="res://shaders/buffer_sky.gdshader" id="5_11ck4"]
|
|
||||||
|
|
||||||
[sub_resource type="Environment" id="Environment_upbsr"]
|
|
||||||
|
|
||||||
[sub_resource type="World3D" id="World3D_dhs8m"]
|
|
||||||
environment = SubResource("Environment_upbsr")
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_syhg6"]
|
|
||||||
render_priority = 0
|
|
||||||
shader = ExtResource("5_11ck4")
|
|
||||||
shader_parameter/rayleigh = 2.0
|
|
||||||
shader_parameter/rayleigh_color = Color(0.3, 0.405, 0.6, 1)
|
|
||||||
shader_parameter/mie = 0.005
|
|
||||||
shader_parameter/mie_eccentricity = 0.8
|
|
||||||
shader_parameter/mie_color = Color(1, 0.811765, 0.552941, 1)
|
|
||||||
shader_parameter/turbidity = 10.0
|
|
||||||
shader_parameter/sun_disk_scale = 1.0
|
|
||||||
shader_parameter/ground_color = Color(0.1, 0.07, 0.034, 1)
|
|
||||||
shader_parameter/exposure = 1.0
|
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_ruwh8"]
|
|
||||||
flip_faces = true
|
|
||||||
radial_segments = 8
|
|
||||||
rings = 4
|
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_dago3"]
|
|
||||||
viewport_path = NodePath("buffer_sky")
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_3xcas"]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
render_priority = 0
|
|
||||||
shader = ExtResource("3_p8xnm")
|
|
||||||
shader_parameter/render_normal_offset = 7.0
|
|
||||||
shader_parameter/render_normal_blur = 10.0
|
|
||||||
shader_parameter/render_ao_amount = 2.0
|
|
||||||
shader_parameter/render_hg_base = 0.7
|
|
||||||
shader_parameter/render_hg_amount = 0.5
|
|
||||||
shader_parameter/render_hg_mask = 0.05
|
|
||||||
shader_parameter/render_hg_color_saturation = 1.0
|
|
||||||
shader_parameter/render_hg_color_power = 0.2
|
|
||||||
shader_parameter/render_sky_color_saturation = 1.0
|
|
||||||
shader_parameter/render_direct_shadow_ramp_dist = 1000.0
|
|
||||||
shader_parameter/render_direct_shadow_jitter = 0.05
|
|
||||||
shader_parameter/render_short_shadow_amount = 0.1
|
|
||||||
shader_parameter/render_short_shadow_dist = 70.0
|
|
||||||
shader_parameter/render_smooth_shadow_offset = 150.0
|
|
||||||
shader_parameter/render_smooth_shadow_bias = 100.0
|
|
||||||
shader_parameter/render_smooth_shadow_amount = 1.0
|
|
||||||
shader_parameter/buffer_sky = SubResource("ViewportTexture_dago3")
|
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_jgq0g"]
|
|
||||||
flip_faces = true
|
|
||||||
radius = 9000.0
|
|
||||||
height = 18000.0
|
|
||||||
radial_segments = 8
|
|
||||||
rings = 4
|
|
||||||
|
|
||||||
[node name="clouds" type="Node"]
|
|
||||||
script = ExtResource("1_artgg")
|
|
||||||
|
|
||||||
[node name="buffer_sky" type="SubViewport" parent="."]
|
|
||||||
own_world_3d = true
|
|
||||||
world_3d = SubResource("World3D_dhs8m")
|
|
||||||
use_hdr_2d = true
|
|
||||||
positional_shadow_atlas_size = 64
|
|
||||||
positional_shadow_atlas_16_bits = false
|
|
||||||
size = Vector2i(128, 64)
|
|
||||||
|
|
||||||
[node name="sky" type="MeshInstance3D" parent="buffer_sky"]
|
|
||||||
material_override = SubResource("ShaderMaterial_syhg6")
|
|
||||||
cast_shadow = 0
|
|
||||||
extra_cull_margin = 16384.0
|
|
||||||
ignore_occlusion_culling = true
|
|
||||||
gi_mode = 0
|
|
||||||
mesh = SubResource("SphereMesh_ruwh8")
|
|
||||||
skeleton = NodePath("../..")
|
|
||||||
|
|
||||||
[node name="camera" type="Camera3D" parent="buffer_sky"]
|
|
||||||
|
|
||||||
[node name="clouds" type="MeshInstance3D" parent="."]
|
|
||||||
material_override = SubResource("ShaderMaterial_3xcas")
|
|
||||||
cast_shadow = 0
|
|
||||||
gi_mode = 0
|
|
||||||
mesh = SubResource("SphereMesh_jgq0g")
|
|
@ -1,83 +0,0 @@
|
|||||||
|
|
||||||
// NOTE: Shader automatically converted from Godot Engine 4.1.1.stable's PhysicalSkyMaterial.
|
|
||||||
|
|
||||||
shader_type sky;
|
|
||||||
|
|
||||||
uniform float rayleigh : hint_range(0, 64) = 2.0;
|
|
||||||
uniform vec4 rayleigh_color : source_color = vec4(0.3, 0.405, 0.6, 1.0);
|
|
||||||
uniform float mie : hint_range(0, 1) = 0.005;
|
|
||||||
uniform float mie_eccentricity : hint_range(-1, 1) = 0.8;
|
|
||||||
uniform vec4 mie_color : source_color = vec4(0.69, 0.729, 0.812, 1.0);
|
|
||||||
|
|
||||||
uniform float turbidity : hint_range(0, 1000) = 10.0;
|
|
||||||
uniform float sun_disk_scale : hint_range(0, 360) = 1.0;
|
|
||||||
uniform vec4 ground_color : source_color = vec4(0.1, 0.07, 0.034, 1.0);
|
|
||||||
uniform float exposure : hint_range(0, 128) = 1.0;
|
|
||||||
|
|
||||||
uniform sampler2D night_sky : filter_linear, source_color, hint_default_black;
|
|
||||||
|
|
||||||
const vec3 UP = vec3( 0.0, 1.0, 0.0 );
|
|
||||||
|
|
||||||
// Optical length at zenith for molecules.
|
|
||||||
const float rayleigh_zenith_size = 8.4e3;
|
|
||||||
const float mie_zenith_size = 1.25e3;
|
|
||||||
|
|
||||||
float henyey_greenstein(float cos_theta, float g) {
|
|
||||||
const float k = 0.0795774715459;
|
|
||||||
return k * (1.0 - g * g) / (pow(1.0 + g * g - 2.0 * g * cos_theta, 1.5));
|
|
||||||
}
|
|
||||||
|
|
||||||
void sky() {
|
|
||||||
if (LIGHT0_ENABLED) {
|
|
||||||
float zenith_angle = clamp( dot(UP, normalize(LIGHT0_DIRECTION)), -1.0, 1.0 );
|
|
||||||
float sun_energy = max(0.0, 1.0 - exp(-((PI * 0.5) - acos(zenith_angle)))) * LIGHT0_ENERGY;
|
|
||||||
float sun_fade = 1.0 - clamp(1.0 - exp(LIGHT0_DIRECTION.y), 0.0, 1.0);
|
|
||||||
|
|
||||||
// Rayleigh coefficients.
|
|
||||||
float rayleigh_coefficient = rayleigh - ( 1.0 * ( 1.0 - sun_fade ) );
|
|
||||||
vec3 rayleigh_beta = rayleigh_coefficient * rayleigh_color.rgb * 0.0001;
|
|
||||||
// mie coefficients from Preetham
|
|
||||||
vec3 mie_beta = turbidity * mie * mie_color.rgb * 0.000434;
|
|
||||||
|
|
||||||
// Optical length.
|
|
||||||
float zenith = acos(max(0.0, dot(UP, EYEDIR)));
|
|
||||||
float optical_mass = 1.0 / (cos(zenith) + 0.15 * pow(93.885 - degrees(zenith), -1.253));
|
|
||||||
float rayleigh_scatter = rayleigh_zenith_size * optical_mass;
|
|
||||||
float mie_scatter = mie_zenith_size * optical_mass;
|
|
||||||
|
|
||||||
// Light extinction based on thickness of atmosphere.
|
|
||||||
vec3 extinction = exp(-(rayleigh_beta * rayleigh_scatter + mie_beta * mie_scatter));
|
|
||||||
|
|
||||||
// In scattering.
|
|
||||||
float cos_theta = dot(EYEDIR, normalize(LIGHT0_DIRECTION));
|
|
||||||
|
|
||||||
float rayleigh_phase = (3.0 / (16.0 * PI)) * (1.0 + pow(cos_theta * 0.5 + 0.5, 2.0));
|
|
||||||
vec3 betaRTheta = rayleigh_beta * rayleigh_phase;
|
|
||||||
|
|
||||||
float mie_phase = henyey_greenstein(cos_theta, mie_eccentricity);
|
|
||||||
vec3 betaMTheta = mie_beta * mie_phase;
|
|
||||||
|
|
||||||
vec3 Lin = pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * (1.0 - extinction), vec3(1.5));
|
|
||||||
// Hack from https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Sky.js
|
|
||||||
Lin *= mix(vec3(1.0), pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * extinction, vec3(0.5)), clamp(pow(1.0 - zenith_angle, 5.0), 0.0, 1.0));
|
|
||||||
|
|
||||||
// Hack in the ground color.
|
|
||||||
Lin *= mix(ground_color.rgb, vec3(1.0), smoothstep(-0.1, 0.1, dot(UP, EYEDIR)));
|
|
||||||
|
|
||||||
// Solar disk and out-scattering.
|
|
||||||
float sunAngularDiameterCos = cos(LIGHT0_SIZE * sun_disk_scale);
|
|
||||||
float sunAngularDiameterCos2 = cos(LIGHT0_SIZE * sun_disk_scale*0.5);
|
|
||||||
|
|
||||||
float sundisk = smoothstep(sunAngularDiameterCos, sunAngularDiameterCos2, cos_theta);
|
|
||||||
vec3 L0 = (sun_energy * extinction) * sundisk * LIGHT0_COLOR;
|
|
||||||
L0 += texture(night_sky, SKY_COORDS).xyz * extinction;
|
|
||||||
|
|
||||||
vec3 color = Lin + L0;
|
|
||||||
COLOR = pow(color, vec3(1.0 / (1.2 + (1.2 * sun_fade))));
|
|
||||||
COLOR *= exposure;
|
|
||||||
} else {
|
|
||||||
// There is no sun, so display night_sky and nothing else.
|
|
||||||
COLOR = texture(night_sky, SKY_COORDS).xyz;
|
|
||||||
COLOR *= exposure;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,115 +0,0 @@
|
|||||||
shader_type spatial;
|
|
||||||
render_mode unshaded, shadows_disabled;
|
|
||||||
|
|
||||||
// Global Sun Light Variables
|
|
||||||
global uniform vec3 sun_light_direction;
|
|
||||||
global uniform float sun_light_energy;
|
|
||||||
global uniform vec3 sun_light_color;
|
|
||||||
|
|
||||||
// Sky Shader
|
|
||||||
uniform float rayleigh : hint_range(0, 64) = 2.0;
|
|
||||||
uniform vec4 rayleigh_color : source_color = vec4(0.3, 0.405, 0.6, 1.0);
|
|
||||||
uniform float mie : hint_range(0, 1) = 0.005;
|
|
||||||
uniform float mie_eccentricity : hint_range(-1, 1) = 0.8;
|
|
||||||
uniform vec4 mie_color : source_color = vec4(0.69, 0.729, 0.812, 1.0);
|
|
||||||
|
|
||||||
uniform float turbidity : hint_range(0, 1000) = 10.0;
|
|
||||||
uniform float sun_disk_scale : hint_range(0, 360) = 1.0;
|
|
||||||
uniform vec4 ground_color : source_color = vec4(0.1, 0.07, 0.034, 1.0);
|
|
||||||
uniform float exposure : hint_range(0, 128) = 1.0;
|
|
||||||
|
|
||||||
// Sun constants
|
|
||||||
const float light_size = 0.00872663806;
|
|
||||||
const float SUN_ENERGY = 1000.0; //OLD 1000.0
|
|
||||||
|
|
||||||
// optical length at zenith for molecules
|
|
||||||
const float rayleigh_zenith_size = 8.4e3;
|
|
||||||
const float mie_zenith_size = 1.25e3;
|
|
||||||
const vec3 UP = vec3( 0.0, 1.0, 0.0 );
|
|
||||||
|
|
||||||
vec2 dir_to_skybox_uv(vec3 dir) {
|
|
||||||
vec2 uv = vec2(atan(dir.x, -dir.z), acos(dir.y));
|
|
||||||
if (uv.x < 0.0) {
|
|
||||||
uv.x += PI * 2.0;
|
|
||||||
}
|
|
||||||
return (uv / vec2(PI * 2.0, PI));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 skybox_uv_to_dir(vec2 uv) {
|
|
||||||
uv = (uv - 0.5) * vec2(-2.0, -1.0) * PI;
|
|
||||||
vec3 r_dir = normalize( vec3( sin(uv.x), tan(uv.y), cos(uv.x) ) * cos(uv.y) );
|
|
||||||
return r_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
// cheaper than smoothstep() linear version
|
|
||||||
float linearstepc(float a, float b, float value) {
|
|
||||||
return clamp((value - a) / (b-a),0.0,1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
float henyey_greenstein(float cos_theta, float g) {
|
|
||||||
const float k = 0.0795774715459;
|
|
||||||
return k * (1.0 - g * g) / (pow(1.0 + g * g - 2.0 * g * cos_theta, 1.5));
|
|
||||||
}
|
|
||||||
|
|
||||||
float cos_theta(vec3 r_dir, vec3 light_dir) {
|
|
||||||
return dot(r_dir, normalize(light_dir));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 atmosphere_clouds(vec3 eye_dir) {
|
|
||||||
float zenith_angle = clamp( dot( UP, normalize(sun_light_direction)), -1.0, 1.0 );
|
|
||||||
float sun_energy = max(0.0, 1.0 - exp(-((PI * 0.5) - acos(zenith_angle)))) * sun_light_energy;
|
|
||||||
float sun_fade = 1.0 - clamp(1.0 - exp(normalize(sun_light_direction).y), 0.0, 1.0);
|
|
||||||
|
|
||||||
// Rayleigh coefficients.
|
|
||||||
float rayleigh_coefficient = rayleigh - ( 1.0 * ( 1.0 - sun_fade ) );
|
|
||||||
vec3 rayleigh_beta = rayleigh_coefficient * rayleigh_color.rgb * 0.0001;
|
|
||||||
// mie coefficients from Preetham
|
|
||||||
vec3 mie_beta = turbidity * mie * mie_color.rgb * 0.000434;
|
|
||||||
|
|
||||||
// optical length
|
|
||||||
float zenith = acos(max(0.0, dot( UP, eye_dir)));
|
|
||||||
float optical_mass = 1.0 / (cos(zenith) + 0.15 * pow(93.885 - degrees(zenith), -1.253));
|
|
||||||
float rayleigh_scatter = rayleigh_zenith_size * optical_mass;
|
|
||||||
float mie_scatter = mie_zenith_size * optical_mass;
|
|
||||||
|
|
||||||
// light extinction based on thickness of atmosphere
|
|
||||||
vec3 extinction = exp(-(rayleigh_beta * rayleigh_scatter + mie_beta * mie_scatter));
|
|
||||||
|
|
||||||
// in scattering
|
|
||||||
float cos_theta = dot(eye_dir, normalize(sun_light_direction));
|
|
||||||
|
|
||||||
float rayleigh_phase = (3.0 / (16.0 * PI)) * (1.0 + pow(cos_theta * 0.5 + 0.5, 2.0));
|
|
||||||
vec3 betaRTheta = rayleigh_beta * rayleigh_phase;
|
|
||||||
|
|
||||||
float mie_phase = henyey_greenstein(cos_theta, mie_eccentricity);
|
|
||||||
vec3 betaMTheta = mie_beta * mie_phase;
|
|
||||||
|
|
||||||
vec3 Lin = pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * (1.0 - extinction), vec3(1.5));
|
|
||||||
// Hack from https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/Sky.js
|
|
||||||
Lin *= mix(vec3(1.0), pow(sun_energy * ((betaRTheta + betaMTheta) / (rayleigh_beta + mie_beta)) * extinction, vec3(0.5)), clamp(pow(1.0 - zenith_angle, 5.0), 0.0, 1.0));
|
|
||||||
|
|
||||||
vec3 color;
|
|
||||||
// Hack in the ground color
|
|
||||||
//Lin *= mix(ground_color.rgb, vec3(1.0), smoothstep(-0.1, 0.1, dot(UP, EYEDIR)));
|
|
||||||
//Lin *= mix(ground_color.rgb, vec3(1.0), linearstepc(-0.1, 0.1, dot(UP, eye_dir)));
|
|
||||||
// Modified For Clouds
|
|
||||||
Lin *= mix(ground_color.rgb, vec3(1.0), linearstepc(-0.9, 0.1, dot(UP, eye_dir)) * 0.9 + 0.1 );
|
|
||||||
|
|
||||||
// Solar disk and out-scattering
|
|
||||||
float sunAngularDiameterCos = cos(light_size * sun_disk_scale);
|
|
||||||
float sunAngularDiameterCos2 = cos(light_size * sun_disk_scale * 0.5);
|
|
||||||
float sundisk = smoothstep(sunAngularDiameterCos, sunAngularDiameterCos2, cos_theta);
|
|
||||||
vec3 L0 = (sun_energy * extinction) * sundisk * sun_light_color.xyz;
|
|
||||||
//L0 += texture(night_sky, SKY_COORDS).xyz * extinction;
|
|
||||||
|
|
||||||
color = Lin + L0;
|
|
||||||
color = pow(color, vec3(1.0 / (1.2 + (1.2 * sun_fade) ) ) );
|
|
||||||
color *= exposure;
|
|
||||||
|
|
||||||
return color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void fragment() {
|
|
||||||
vec3 sky_direction = skybox_uv_to_dir(SCREEN_UV);
|
|
||||||
ALBEDO = atmosphere_clouds(sky_direction);
|
|
||||||
}
|
|
@ -1,156 +0,0 @@
|
|||||||
// Global Wind Vector
|
|
||||||
global uniform vec2 wind_vector;
|
|
||||||
global uniform float wind_uplift;
|
|
||||||
|
|
||||||
// Global Cloud Textures
|
|
||||||
global uniform sampler3D cloud_base_texture : hint_anisotropy, filter_linear, repeat_enable;
|
|
||||||
global uniform sampler3D cloud_detail_texture : hint_anisotropy, filter_linear, repeat_enable;
|
|
||||||
global uniform sampler3D cloud_volume_texture : hint_anisotropy, filter_linear, repeat_enable;
|
|
||||||
|
|
||||||
// Global Sun Light Variables
|
|
||||||
global uniform vec3 sun_light_direction;
|
|
||||||
global uniform float sun_light_energy;
|
|
||||||
global uniform vec3 sun_light_color;
|
|
||||||
|
|
||||||
// Global Cloud Variables
|
|
||||||
// Base
|
|
||||||
global uniform float cloud_base_height;
|
|
||||||
global uniform float cloud_base_scale;
|
|
||||||
global uniform float cloud_base_squeeze;
|
|
||||||
// Detail
|
|
||||||
global uniform float cloud_detail_scale;
|
|
||||||
global uniform float cloud_detail_amount;
|
|
||||||
global uniform float cloud_detail_dist;
|
|
||||||
// Volume
|
|
||||||
global uniform float cloud_volume_scale;
|
|
||||||
global uniform float cloud_volume_density_low;
|
|
||||||
global uniform float cloud_volume_density_high;
|
|
||||||
|
|
||||||
float pow2(float x){
|
|
||||||
return x*x;
|
|
||||||
}
|
|
||||||
|
|
||||||
float pow3(float x){
|
|
||||||
return x*x*x;
|
|
||||||
}
|
|
||||||
|
|
||||||
float pow4(float x){
|
|
||||||
return pow2(pow2(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
float hash13(vec3 p3) {
|
|
||||||
p3 = fract(p3 * .1031);
|
|
||||||
p3 += dot(p3, p3.zyx + 31.32);
|
|
||||||
return fract((p3.x + p3.y) * p3.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
float hash14(vec4 p4) {
|
|
||||||
p4 = fract(p4 * vec4(.1031, .1030, .0973, .1099));
|
|
||||||
p4 += dot(p4, p4.wzxy+33.33);
|
|
||||||
return fract((p4.x + p4.y) * (p4.z + p4.w));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 hash33(vec3 p3) {
|
|
||||||
p3 = fract(p3 * vec3(.1031, .1030, .0973));
|
|
||||||
p3 += dot(p3, p3.yxz+33.33);
|
|
||||||
return fract((p3.xxy + p3.yxx)*p3.zyx);
|
|
||||||
}
|
|
||||||
|
|
||||||
// linear version of smoothstep
|
|
||||||
float linearstepc(float a, float b, float value) {
|
|
||||||
return clamp((value - a) / (b-a),0.0,1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 saturation(vec3 rgb, float adjustment) {
|
|
||||||
const vec3 v = vec3(0.2125, 0.7154, 0.0721);
|
|
||||||
vec3 intensity = vec3(dot(rgb, v));
|
|
||||||
return mix(intensity, rgb, adjustment);
|
|
||||||
}
|
|
||||||
|
|
||||||
float lum(vec3 rgb) {
|
|
||||||
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
|
|
||||||
return dot(rgb, w);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec4 get_cloud_transform() {
|
|
||||||
vec4 cloud_transform = vec4(0.0, cloud_base_height, 0.0, cloud_base_scale);
|
|
||||||
cloud_transform.xz += vec2(TIME * wind_vector.x, TIME * wind_vector.y);
|
|
||||||
return cloud_transform;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
float get_cloud_density(in vec3 r_pos) {
|
|
||||||
vec2 tiling = 0.00002 * r_pos.xz;
|
|
||||||
return texture(cloud_density_texture, tiling * 1.37).x * texture(cloud_density_texture, tiling * 0.57).y;
|
|
||||||
}
|
|
||||||
|
|
||||||
float get_cloud_base(in vec4 r_ori, in vec4 r_dir, in vec4 transform) {
|
|
||||||
// Ray Position With Added Offset
|
|
||||||
vec3 r_pos = (r_ori.xyz - transform.xyz) + (r_dir.xyz * r_dir.w);
|
|
||||||
r_pos *= vec3(cloud_base_squeeze, 1.0, cloud_base_squeeze);
|
|
||||||
// Avoid Bleeding From Upper and Lower Texture Tile
|
|
||||||
//r_pos.y = clamp(r_pos.y, -0.5 * transform.w, 0.5 * transform.w);
|
|
||||||
float clamp_height = clamp( (0.5 * transform.w - abs(r_pos.y)), -1000.0, 0.0);
|
|
||||||
// Get Current Signed Distance At Position (Add Scaling)
|
|
||||||
//return texture(cloud_base_texture, (r_pos.xyz / transform.w + vec3(0.5, 0.5, 0.5) ) ) * transform.w - clamp_height;
|
|
||||||
vec2 dist_all = texture(cloud_base_texture, (r_pos.xyz / transform.w + vec3(0.5, 0.5, 0.5) ) ).xz * transform.w - clamp_height;
|
|
||||||
|
|
||||||
float dist_mask = get_cloud_density(r_pos);
|
|
||||||
float dist_out = mix( dist_all.x, dist_all.y, linearstepc(0.3, 0.6, dist_mask) );
|
|
||||||
return dist_out;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
float get_cloud_base(in vec4 r_ori, in vec4 r_dir, in vec4 transform) {
|
|
||||||
// Ray Position With Added Offset
|
|
||||||
vec3 r_pos = (r_ori.xyz - transform.xyz) + (r_dir.xyz * r_dir.w);
|
|
||||||
r_pos *= vec3(cloud_base_squeeze, 1.0, cloud_base_squeeze);
|
|
||||||
// Avoid Bleeding From Upper and Lower Texture Tile
|
|
||||||
//r_pos.y = clamp(r_pos.y, -0.5 * transform.w, 0.5 * transform.w);
|
|
||||||
float clamp_height = clamp( (0.5 * transform.w - abs(r_pos.y)), -1000.0, 0.0);
|
|
||||||
// Get Current Signed Distance At Position (Add Scaling)
|
|
||||||
//return texture(cloud_base_texture, (r_pos.xyz / transform.w + vec3(0.5, 0.5, 0.5) ) ) * transform.w - clamp_height;
|
|
||||||
float dist = texture(cloud_base_texture, (r_pos.xyz / transform.w + vec3(0.5, 0.5, 0.5) ) ).z * transform.w - clamp_height;
|
|
||||||
return dist;
|
|
||||||
}
|
|
||||||
|
|
||||||
float get_cloud_detail(in vec4 r_ori, in vec4 r_dir, in vec4 transform) {
|
|
||||||
// Ray Position With Added Offset
|
|
||||||
vec3 detail_transform = transform.xyz;
|
|
||||||
detail_transform.y += wind_uplift * r_ori.w;
|
|
||||||
vec3 r_pos = (r_ori.xyz - detail_transform) + (r_dir.xyz * r_dir.w);
|
|
||||||
// Get Current Signed Distance At Position (Add Scaling)E
|
|
||||||
return texture(cloud_detail_texture, (r_pos.xyz / transform.w ) ).x * transform.w;
|
|
||||||
}
|
|
||||||
|
|
||||||
float get_cloud_volume(in vec4 r_ori, in vec4 r_dir, in vec4 transform) {
|
|
||||||
// Ray Position With Added Offset
|
|
||||||
vec3 volume_transform = transform.xyz;
|
|
||||||
volume_transform.y += wind_uplift * r_ori.w * 2.0;
|
|
||||||
vec3 r_pos = (r_ori.xyz - volume_transform) + (r_dir.xyz * r_dir.w);
|
|
||||||
// Get Current Volume Texture At Position (Add Scaling)
|
|
||||||
return texture(cloud_volume_texture, r_pos.xyz / transform.w ).x;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 dir_to_skybox_uv(vec3 dir) {
|
|
||||||
vec2 uv = vec2(atan(dir.x, -dir.z), acos(dir.y));
|
|
||||||
if (uv.x < 0.0) {
|
|
||||||
uv.x += PI * 2.0;
|
|
||||||
}
|
|
||||||
return (uv / vec2(PI * 2.0, PI));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 skybox_uv_to_dir(vec2 uv) {
|
|
||||||
uv = (uv - 0.5) * vec2(-2.0, -1.0) * PI;
|
|
||||||
vec3 r_dir = normalize( vec3( sin(uv.x), tan(uv.y), cos(uv.x) ) * cos(uv.y) );
|
|
||||||
return r_dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
float henyey_greenstein(float cos_theta, float g) {
|
|
||||||
const float k = 0.0795774715459;
|
|
||||||
return k * (1.0 - g * g) / (pow(1.0 + g * g - 2.0 * g * cos_theta, 1.5));
|
|
||||||
}
|
|
||||||
|
|
||||||
float cos_theta(vec3 r_dir, vec3 light_dir) {
|
|
||||||
return dot(r_dir, light_dir);
|
|
||||||
}
|
|
@ -1,269 +0,0 @@
|
|||||||
#define CAMERA_CLIP 20000.0
|
|
||||||
#define R_STEP_MAX 200
|
|
||||||
#define R_DIST_MIN 1.0
|
|
||||||
#define R_DIST_MAX 40000.0
|
|
||||||
#define R_DIST_START_OFFSET 16.0
|
|
||||||
#define V_STEP_SIZE 10.0
|
|
||||||
#define V_STEP_SIZE_DIST_MULTIPLIER 10.0
|
|
||||||
#define L_STEP_MAX 15.0
|
|
||||||
#define L_STEP_MIN 2.0
|
|
||||||
#define L_STEP_MIN_DIST 40000.0
|
|
||||||
|
|
||||||
shader_type spatial;
|
|
||||||
render_mode unshaded, shadows_disabled;
|
|
||||||
|
|
||||||
#include "res://shaders/cloud_functions.gdshaderinc"
|
|
||||||
|
|
||||||
uniform sampler2D buffer_sky : source_color, filter_linear, repeat_disable;
|
|
||||||
|
|
||||||
uniform float render_normal_offset = 7.0;
|
|
||||||
uniform float render_normal_blur = 7.0;
|
|
||||||
uniform float render_ao_amount = 2.0;
|
|
||||||
uniform float render_hg_base = 0.7;
|
|
||||||
uniform float render_hg_amount = 0.5;
|
|
||||||
uniform float render_hg_mask = 0.05;
|
|
||||||
uniform float render_hg_color_saturation = 1.0;
|
|
||||||
uniform float render_hg_color_power = 0.2;
|
|
||||||
uniform float render_sky_color_saturation = 1.0;
|
|
||||||
|
|
||||||
uniform float render_direct_shadow_ramp_dist = 1000.0;
|
|
||||||
uniform float render_direct_shadow_jitter = 0.05;
|
|
||||||
uniform float render_short_shadow_amount = 0.1;
|
|
||||||
uniform float render_short_shadow_dist = 70.0;
|
|
||||||
|
|
||||||
uniform float render_smooth_shadow_offset = 150.0;
|
|
||||||
uniform float render_smooth_shadow_bias = 100.0;
|
|
||||||
uniform float render_smooth_shadow_amount = 1.0;
|
|
||||||
|
|
||||||
void raymarch_cloud(in vec4 r_ori, in vec4 r_dir, in vec4 cloud_transform, inout vec3 cloud_out ) {
|
|
||||||
// Buffer Vars
|
|
||||||
float density = 0.0;
|
|
||||||
float ao = 1.0;
|
|
||||||
// Screen Noise
|
|
||||||
float noise = hash14(vec4(r_dir.xyz * 1000.0, r_ori.w)) - 0.5;
|
|
||||||
// Calculate Back Distance of BBox
|
|
||||||
float r_back_height = max( abs(r_ori.y - cloud_base_height) + cloud_base_scale * 0.5, 0.0);
|
|
||||||
float r_dist_back = r_back_height / abs(r_dir.y);
|
|
||||||
// Start Distance
|
|
||||||
float dist_ori = r_dir.w;
|
|
||||||
|
|
||||||
// Inside Clip
|
|
||||||
for(int r_step = 0; r_step < R_STEP_MAX; r_step++) {
|
|
||||||
float dist = get_cloud_base(r_ori, vec4(r_dir.xyz, dist_ori), cloud_transform);
|
|
||||||
|
|
||||||
if(dist <= cloud_detail_dist) {
|
|
||||||
dist = mix(dist, get_cloud_detail(r_ori, vec4(r_dir.xyz, dist_ori), vec4(cloud_transform.xyz, cloud_detail_scale) ), cloud_detail_amount );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cloud SDF Shape Min Reached
|
|
||||||
if(dist <= R_DIST_MIN) {
|
|
||||||
// Volume March Stop Condition
|
|
||||||
bool v_stop = false;
|
|
||||||
|
|
||||||
// Volume Marching
|
|
||||||
while(v_stop == false) {
|
|
||||||
// Get Dist From SDF Texture To Calculate Density
|
|
||||||
float v_dist = get_cloud_base(r_ori, vec4(r_dir.xyz, dist_ori), cloud_transform);
|
|
||||||
v_dist = mix(v_dist, get_cloud_detail(r_ori, vec4(r_dir.xyz, dist_ori), vec4(cloud_transform.xyz, cloud_detail_scale) ), cloud_detail_amount );
|
|
||||||
// Leave While-Loop When Not Inside Cloud Volume Shape (SDF < 0.0)
|
|
||||||
if(v_dist > R_DIST_MIN) {
|
|
||||||
v_stop = true;
|
|
||||||
}
|
|
||||||
// Inside Cloud Density
|
|
||||||
float v_density = max(-v_dist, 0.0);
|
|
||||||
// Adding Complexity as AO
|
|
||||||
ao *= (1.0 - v_density * render_ao_amount * 0.001);
|
|
||||||
// Current Density Of Volume
|
|
||||||
float v_tex_density = linearstepc( cloud_volume_density_low, cloud_volume_density_high, get_cloud_volume(r_ori, vec4(r_dir.xyz, dist_ori), vec4(cloud_transform.xyz, cloud_volume_scale) ) * v_density );
|
|
||||||
// Volume Step Size Adding To Distance To Origin
|
|
||||||
float dist_step_size = 1.0 + (dist_ori / R_DIST_MAX) * V_STEP_SIZE_DIST_MULTIPLIER;
|
|
||||||
// Add Current Density To Density Buffer (Use Hash for Correct Sorting)
|
|
||||||
//density += v_tex_density;
|
|
||||||
density += step( hash13( vec3(r_ori.xyz + r_dir.xyz * dist_ori) ), v_tex_density); // Noise For Pixel Perfect Mask
|
|
||||||
// Add Raymarched Distance To Distance To Origin
|
|
||||||
dist_ori += (V_STEP_SIZE + noise * V_STEP_SIZE) * dist_step_size;
|
|
||||||
//dist_ori += V_STEP_SIZE * dist_step_size;
|
|
||||||
|
|
||||||
if(density >= 1.0 || dist_ori > R_DIST_MAX) {
|
|
||||||
if(density >= 1.0) {
|
|
||||||
// Inside Clip ( Cloud SDF + Cloud Volume )
|
|
||||||
cloud_out = vec3(ao, dist_ori, 1.0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cloud_out = vec3(ao, R_DIST_MAX, density);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dist_ori += dist;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( dist_ori > R_DIST_MAX || dist_ori > r_dist_back ) {
|
|
||||||
// Inside Clip (When Going Outside of BBox Or Further Than Max Ray-Dist)
|
|
||||||
cloud_out = vec3(ao, R_DIST_MAX, density);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inside Clip (Max Ray-Steps Is Reached)
|
|
||||||
cloud_out = vec3(ao, dist_ori, density);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void lightmarch_cloud(in vec4 r_ori, in vec4 r_dir, in vec4 cloud_transform, inout vec3 color_out ) {
|
|
||||||
float ao = color_out.x;
|
|
||||||
float dist_ori = color_out.y;
|
|
||||||
// Get World Position Based On Distance
|
|
||||||
vec3 world_pos = r_ori.xyz + r_dir.xyz * dist_ori;
|
|
||||||
// Cos-Theta Used for Scattering
|
|
||||||
float cos_theta = cos_theta(r_dir.xyz, sun_light_direction);
|
|
||||||
// Cloud Density At World Position
|
|
||||||
float cloud_density = get_cloud_base(r_ori, vec4(r_dir.xyz, dist_ori), cloud_transform);
|
|
||||||
cloud_density = mix(cloud_density, get_cloud_detail(r_ori, vec4(r_dir.xyz, dist_ori), vec4(cloud_transform.xyz, cloud_detail_scale) ), cloud_detail_amount );
|
|
||||||
// Cloud Density At Normal Offset (No Detail Pass)
|
|
||||||
float cloud_density_offset_forward = get_cloud_base(vec4(world_pos, r_ori.w), vec4(vec3(0.0, 0.0, render_normal_offset), render_normal_offset), cloud_transform);
|
|
||||||
float cloud_density_offset_up = get_cloud_base(vec4(world_pos, r_ori.w), vec4(vec3(0.0, render_normal_offset, 0.0), render_normal_offset), cloud_transform);
|
|
||||||
float cloud_density_offset_right = get_cloud_base(vec4(world_pos, r_ori.w), vec4(vec3(render_normal_offset, 0.0, 0.0), render_normal_offset), cloud_transform);
|
|
||||||
// Cloud Normal
|
|
||||||
vec3 cloud_normal;
|
|
||||||
cloud_normal.x = (cloud_density_offset_right - cloud_density);
|
|
||||||
cloud_normal.y = (cloud_density_offset_up - cloud_density);
|
|
||||||
cloud_normal.z = (cloud_density_offset_forward - cloud_density);
|
|
||||||
cloud_normal /= render_normal_offset;
|
|
||||||
cloud_normal = normalize(cloud_normal);
|
|
||||||
// Cloud Density At Upper Offset For Smooth Shadow
|
|
||||||
float cloud_density_smooth = get_cloud_base(vec4(world_pos, r_ori.w), vec4( vec3(0.0, 1.0, 0.0), render_smooth_shadow_offset), cloud_transform);
|
|
||||||
cloud_density_smooth = exp( max(-cloud_density_smooth + render_smooth_shadow_bias, 0.0) * -render_smooth_shadow_amount * 0.001);
|
|
||||||
// Cloud Density At Screen Space Offset (Used For Henyey Greenstein To Determine Density)
|
|
||||||
float cloud_density_offset_sss = get_cloud_base(vec4(world_pos, r_ori.w), vec4(r_dir.xyz, 50.0), cloud_transform);
|
|
||||||
cloud_density_offset_sss = mix(cloud_density_offset_sss, get_cloud_detail(vec4(world_pos, r_ori.w), vec4(r_dir.xyz, 50.0), vec4(cloud_transform.xyz, cloud_detail_scale) ), cloud_detail_amount );
|
|
||||||
// Cloud Inner Density
|
|
||||||
float cloud_inner_density = cloud_density;
|
|
||||||
cloud_inner_density = min(cloud_inner_density, cloud_density_offset_sss);
|
|
||||||
// Henhey Greenstein Function
|
|
||||||
float hg_mask = 1.0 - exp( cloud_inner_density * render_hg_mask );
|
|
||||||
float hg_luminance = henyey_greenstein(cos_theta, clamp(render_hg_base - hg_mask, -1.0, 1.0) ) * render_hg_amount;
|
|
||||||
// Color Lighting
|
|
||||||
vec3 hg_color = mix(vec3(hg_luminance), hg_luminance * sun_light_color, pow(cos_theta * 0.5 + 0.5, render_hg_color_power) * render_hg_color_saturation );
|
|
||||||
|
|
||||||
// Sky Sample Ray
|
|
||||||
// Maybe this can be optimized with less normalizations or less samples (but currently this gives best scattering quality)
|
|
||||||
vec3 noise_vector_c = normalize(hash33(world_pos) - 0.5);
|
|
||||||
vec3 noise_vector_1 = normalize(hash33(world_pos * 1.067) - 0.5);
|
|
||||||
vec3 noise_vector_2 = cross(noise_vector_1, noise_vector_c);
|
|
||||||
vec3 noise_vector_3 = cross(noise_vector_1, noise_vector_2);
|
|
||||||
vec3 noise_vector_4 = normalize(hash33(world_pos * 0.971) - 0.5);
|
|
||||||
vec3 noise_vector_5 = cross(noise_vector_4, noise_vector_c);
|
|
||||||
vec3 noise_vector_6 = cross(noise_vector_4, noise_vector_5);
|
|
||||||
|
|
||||||
noise_vector_1 *= render_normal_blur;
|
|
||||||
noise_vector_2 *= render_normal_blur;
|
|
||||||
noise_vector_3 *= render_normal_blur;
|
|
||||||
noise_vector_4 *= render_normal_blur;
|
|
||||||
noise_vector_5 *= render_normal_blur;
|
|
||||||
noise_vector_6 *= render_normal_blur;
|
|
||||||
|
|
||||||
vec3 sky_ray1 = normalize(cloud_normal + noise_vector_1);
|
|
||||||
vec3 sky_ray2 = normalize(cloud_normal - noise_vector_1);
|
|
||||||
vec3 sky_ray3 = normalize(cloud_normal + noise_vector_2);
|
|
||||||
vec3 sky_ray4 = normalize(cloud_normal - noise_vector_2);
|
|
||||||
vec3 sky_ray5 = normalize(cloud_normal + noise_vector_3);
|
|
||||||
vec3 sky_ray6 = normalize(cloud_normal - noise_vector_3);
|
|
||||||
vec3 sky_ray7 = normalize(cloud_normal + noise_vector_4);
|
|
||||||
vec3 sky_ray8 = normalize(cloud_normal - noise_vector_4);
|
|
||||||
vec3 sky_ray9 = normalize(cloud_normal + noise_vector_5);
|
|
||||||
vec3 sky_ray10 = normalize(cloud_normal - noise_vector_5);
|
|
||||||
vec3 sky_ray11 = normalize(cloud_normal + noise_vector_6);
|
|
||||||
vec3 sky_ray12 = normalize(cloud_normal - noise_vector_6);
|
|
||||||
|
|
||||||
vec3 sky_tex = texture(buffer_sky, dir_to_skybox_uv(sky_ray1) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray2) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray3) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray4) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray5) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray6) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray7) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray8) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray9) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray10) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray11) ).xyz;
|
|
||||||
sky_tex += texture(buffer_sky, dir_to_skybox_uv(sky_ray12) ).xyz;
|
|
||||||
|
|
||||||
sky_tex *= 0.08333333333333333333333333333; // 1.0 / 12.0 - 12 samples
|
|
||||||
sky_tex = saturation(sky_tex, render_sky_color_saturation);
|
|
||||||
|
|
||||||
// Calculate Back Distance of BBox For Light Ray Start Point
|
|
||||||
float light_back_height = max( abs(world_pos.y - cloud_base_height - cloud_base_scale * 0.5) , 0.0);
|
|
||||||
float light_dist_back = light_back_height / abs(sun_light_direction.y);
|
|
||||||
// Light March Stop Condition
|
|
||||||
float dist_light = 0.0;
|
|
||||||
// Light Iterations Based On Distance
|
|
||||||
int l_step_max = int(L_STEP_MIN + pow4(1.0 - dist_ori / L_STEP_MIN_DIST) * L_STEP_MAX);
|
|
||||||
|
|
||||||
for(int l_step = 0; l_step < l_step_max; l_step++) {
|
|
||||||
vec3 l_step_pos = world_pos + sun_light_direction * light_dist_back;
|
|
||||||
vec3 l_step_noise = (hash33(l_step_pos) - 0.5) * render_direct_shadow_jitter;
|
|
||||||
float l_dist = get_cloud_base(vec4(l_step_pos, r_ori.w), vec4(-sun_light_direction.xyz + l_step_noise, dist_light), cloud_transform);
|
|
||||||
|
|
||||||
if(l_dist < cloud_detail_dist) {
|
|
||||||
l_dist = mix(l_dist, get_cloud_detail(vec4(l_step_pos, r_ori.w), vec4(-sun_light_direction.xyz + l_step_noise, dist_light), cloud_transform), cloud_detail_amount );
|
|
||||||
if(l_dist < 1.0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dist_light += l_dist;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Short Distance Shadow
|
|
||||||
float short_shadow_mask = get_cloud_base(vec4(world_pos, r_ori.w), vec4(sun_light_direction, render_short_shadow_dist), cloud_transform);
|
|
||||||
short_shadow_mask = mix(short_shadow_mask, get_cloud_detail(vec4(world_pos, r_ori.w), vec4(sun_light_direction, render_short_shadow_dist), vec4(cloud_transform.xyz, cloud_detail_scale) ), cloud_detail_amount );
|
|
||||||
short_shadow_mask = exp( max(-short_shadow_mask, 0.0) * -render_short_shadow_amount);
|
|
||||||
// Directional Shadow Mask Based On Distance To Raymarched Light Ray Hit
|
|
||||||
float dir_shadow_mask = min( pow4( linearstepc(render_direct_shadow_ramp_dist, 0.0, light_dist_back - dist_light) ), short_shadow_mask);
|
|
||||||
// Combined Color Output (Shadow as Mask)
|
|
||||||
color_out = vec3( mix(sky_tex * ao * cloud_density_smooth, sky_tex + hg_color, dir_shadow_mask) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void fragment() {
|
|
||||||
// Ray Direction & Ray Origin by Engine
|
|
||||||
vec3 r_dir = normalize(-VIEW * mat3(VIEW_MATRIX));
|
|
||||||
vec3 r_ori = CAMERA_POSITION_WORLD;
|
|
||||||
|
|
||||||
// Start Distance For Ray Marcher To Save Performance (Calculating BBox)
|
|
||||||
float r_start_height = max( abs(r_ori.y - cloud_base_height) - cloud_base_scale * 0.5 + R_DIST_START_OFFSET, 0.0);
|
|
||||||
float r_dist_start = r_start_height / abs(r_dir.y);
|
|
||||||
|
|
||||||
// Getting Cloud Values Via Raymarch Loop
|
|
||||||
if(r_dist_start < R_DIST_MAX) {
|
|
||||||
// Cloud Transform + Wind (vec4 = X,Y,Z,Scale)
|
|
||||||
vec4 cloud_transform = get_cloud_transform();
|
|
||||||
|
|
||||||
// Buffer Vars (cloud_out, color_out)
|
|
||||||
vec3 cloud_out; // vec3(ao, dist, alpha)
|
|
||||||
raymarch_cloud(vec4(r_ori, TIME), vec4(r_dir, r_dist_start), cloud_transform, cloud_out );
|
|
||||||
//cloud_out.z = step(hash13(r_dir * 1370.0), cloud_out.z);
|
|
||||||
|
|
||||||
// Defer Lights To Get More Performance (its not physically correct but significiantly reduces alus)
|
|
||||||
if(cloud_out.z > 0.0) {
|
|
||||||
vec3 color_out = cloud_out;
|
|
||||||
lightmarch_cloud(vec4(r_ori, TIME), vec4(r_dir, r_dist_start), cloud_transform, color_out );
|
|
||||||
|
|
||||||
ALBEDO = max(color_out, 0.0);
|
|
||||||
ALPHA = cloud_out.z * pow3(linearstepc(R_DIST_MAX, 3000.0, cloud_out.y));
|
|
||||||
// This Clamp Is Due To Max Depth Being Reached By The Current Camera, But Are Still Supposed To Be Rendered In The Background (this clamps the depth-range)
|
|
||||||
vec3 depth_pos = r_ori + r_dir * clamp(cloud_out.y, -CAMERA_CLIP, CAMERA_CLIP);
|
|
||||||
// Converting Z-Depth Back To Depth (Thanks to Zylann & Detox for helping out)
|
|
||||||
vec4 sdf_ndc = PROJECTION_MATRIX * VIEW_MATRIX * vec4(depth_pos, 1.0);
|
|
||||||
DEPTH = sdf_ndc.z / sdf_ndc.w;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 176 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://do7hse6mjnckx"
|
|
||||||
path="res://.godot/imported/cloud_density_a.png-b2ce35c306a954e6c2786c9f25430e0e.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/clouds/cloud_density_a.png"
|
|
||||||
dest_files=["res://.godot/imported/cloud_density_a.png-b2ce35c306a954e6c2786c9f25430e0e.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=3
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
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
|
|
@ -1,26 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="3d_texture"
|
|
||||||
type="CompressedTexture3D"
|
|
||||||
uid="uid://bwvwaoihjy78g"
|
|
||||||
path="res://.godot/imported/cloud_sdf_base.exr-55c0343c3e5f7225fe88952fa3413723.ctex3d"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/clouds/cloud_sdf_base.exr"
|
|
||||||
dest_files=["res://.godot/imported/cloud_sdf_base.exr-55c0343c3e5f7225fe88952fa3413723.ctex3d"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=3
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
slices/horizontal=8
|
|
||||||
slices/vertical=8
|
|
@ -1,26 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="3d_texture"
|
|
||||||
type="CompressedTexture3D"
|
|
||||||
uid="uid://437feiv1oerc"
|
|
||||||
path="res://.godot/imported/cloud_sdf_detail.exr-bd2c9d8e460afae8772a319789981f09.ctex3d"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/clouds/cloud_sdf_detail.exr"
|
|
||||||
dest_files=["res://.godot/imported/cloud_sdf_detail.exr-bd2c9d8e460afae8772a319789981f09.ctex3d"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=3
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
slices/horizontal=8
|
|
||||||
slices/vertical=8
|
|
@ -1,26 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="3d_texture"
|
|
||||||
type="CompressedTexture3D"
|
|
||||||
uid="uid://c4opy6v8qffa3"
|
|
||||||
path="res://.godot/imported/cloud_sdf_detail_b.exr-13df1744e57ce408e090d34f39cc5cd4.ctex3d"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/clouds/cloud_sdf_detail_b.exr"
|
|
||||||
dest_files=["res://.godot/imported/cloud_sdf_detail_b.exr-13df1744e57ce408e090d34f39cc5cd4.ctex3d"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=3
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
slices/horizontal=8
|
|
||||||
slices/vertical=8
|
|
Before Width: | Height: | Size: 495 KiB |
@ -1,27 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="3d_texture"
|
|
||||||
type="CompressedTexture3D"
|
|
||||||
uid="uid://4ncscg8jgec0"
|
|
||||||
path.s3tc="res://.godot/imported/cloud_volume_a.png-959db9024b9de0bc5ca5257ba1c2736d.s3tc.ctex3d"
|
|
||||||
metadata={
|
|
||||||
"imported_formats": ["s3tc_bptc"],
|
|
||||||
"vram_texture": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/clouds/cloud_volume_a.png"
|
|
||||||
dest_files=["res://.godot/imported/cloud_volume_a.png-959db9024b9de0bc5ca5257ba1c2736d.s3tc.ctex3d"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=2
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
slices/horizontal=8
|
|
||||||
slices/vertical=8
|
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://cmg6gbkvjx8vq"
|
|
||||||
path="res://.godot/imported/blue.png-36d07cf579474ce69eeafec9f44e985e.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/default/blue.png"
|
|
||||||
dest_files=["res://.godot/imported/blue.png-36d07cf579474ce69eeafec9f44e985e.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
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=1
|
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://fb815f7h0pns"
|
|
||||||
path="res://.godot/imported/green.png-83e89201777570c08fb0d74113aa7d95.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/default/green.png"
|
|
||||||
dest_files=["res://.godot/imported/green.png-83e89201777570c08fb0d74113aa7d95.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
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=1
|
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://pe1fh6gx30s1"
|
|
||||||
path="res://.godot/imported/grey_128.png-8444cfd68fff6b46d5cdd7a71827aa0e.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/default/grey_128.png"
|
|
||||||
dest_files=["res://.godot/imported/grey_128.png-8444cfd68fff6b46d5cdd7a71827aa0e.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
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=1
|
|
Before Width: | Height: | Size: 1.1 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://chtdv2en1f1mj"
|
|
||||||
path="res://.godot/imported/red.png-e1710c3474896c83349ba6597f1d9683.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://textures/default/red.png"
|
|
||||||
dest_files=["res://.godot/imported/red.png-e1710c3474896c83349ba6597f1d9683.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
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=1
|
|
@ -1,5 +0,0 @@
|
|||||||
[gd_resource type="Gradient" format=3 uid="uid://cwiiu5dy83cai"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
offsets = PackedFloat32Array(0, 0.462366, 0.74552, 0.845878, 0.917563, 0.964158, 1)
|
|
||||||
colors = PackedColorArray(0, 0, 0, 1, 0.190374, 0.218589, 0.25, 1, 0.544241, 0.544241, 0.544241, 1, 0.780357, 0.600883, 0.52394, 1, 0.908482, 0.750369, 0.526467, 1, 0.96021, 0.923893, 0.693084, 1, 1, 1, 1, 1)
|
|
@ -1,5 +0,0 @@
|
|||||||
[gd_resource type="Gradient" format=3 uid="uid://dd0aqwo4wa8yj"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
offsets = PackedFloat32Array(0, 0.53405, 0.741935, 0.792115, 0.867384, 0.917563, 0.960573, 0.983687, 1)
|
|
||||||
colors = PackedColorArray(0, 0, 0, 1, 0.53405, 0.53405, 0.53405, 1, 0.741935, 0.741935, 0.741935, 1, 0.79, 0.740493, 0.7268, 1, 0.87, 0.740515, 0.7047, 1, 0.92, 0.824933, 0.736, 1, 0.96, 0.86256, 0.6816, 1, 0.98, 0.89082, 0.5684, 1, 1, 1, 1, 1)
|
|