Skip to content

Commit

Permalink
add: astro intensity
Browse files Browse the repository at this point in the history
  • Loading branch information
gtibo committed Aug 26, 2023
1 parent b1448e6 commit b87704d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sky/examples/day_sky.tres
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ext_resource type="Shader" path="res://sky/stylized_sky.gdshader" id="1_i5n5i"]

[sub_resource type="Gradient" id="Gradient_hjww8"]
offsets = PackedFloat32Array(0.58, 0.6)
offsets = PackedFloat32Array(0.48, 0.6)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)

[sub_resource type="GradientTexture2D" id="GradientTexture2D_xucge"]
Expand Down Expand Up @@ -47,7 +47,8 @@ shader_parameter/cloud_curves = SubResource("CurveTexture_pcewo")
shader_parameter/top_color = Color(0.34902, 0.588235, 1, 1)
shader_parameter/bottom_color = Color(0, 0.329412, 0.968627, 1)
shader_parameter/sun_scatter = Color(0.298039, 0.298039, 0.298039, 1)
shader_parameter/astro_tint = Color(1, 1, 1, 1)
shader_parameter/astro_tint = Color(0.905882, 0.788235, 0.627451, 1)
shader_parameter/astro_scale = 9.0
shader_parameter/astro_intensity = 3.0
shader_parameter/astro_sampler = SubResource("GradientTexture2D_xucge")
shader_parameter/stars_intensity = 0.0
1 change: 1 addition & 0 deletions sky/examples/night_sky.tres
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ shader_parameter/bottom_color = Color(0.027451, 0.101961, 0.25098, 1)
shader_parameter/sun_scatter = Color(0.12549, 0.0862745, 0.372549, 1)
shader_parameter/astro_tint = Color(1, 1, 1, 1)
shader_parameter/astro_scale = 6.0
shader_parameter/astro_intensity = 1.6
shader_parameter/astro_sampler = SubResource("GradientTexture2D_vg6u4")
shader_parameter/stars_intensity = 1.0
2 changes: 1 addition & 1 deletion sky/examples/sky.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tonemap_mode = 2
glow_enabled = true
glow_bloom = 0.2

[node name="NightSky" type="Node3D"]
[node name="Sky" type="Node3D"]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_1eoep")
Expand Down
3 changes: 2 additions & 1 deletion sky/stylized_sky.gdshader
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ group_uniforms astro;
uniform vec3 astro_tint : source_color;
uniform sampler2D astro_sampler : repeat_disable, filter_linear_mipmap;
uniform float astro_scale : hint_range(0.1, 10.0, 0.1) = 1.0;
uniform float astro_intensity : hint_range(1.0, 3.0, 0.1) = 1.0;

group_uniforms stars;

Expand Down Expand Up @@ -142,7 +143,7 @@ void sky() {

// Add astro

sky_color = mix(sky_color, astro_color.rgb, astro_color.a * astro_mask * bottom_mask);
sky_color = mix(sky_color, astro_color.rgb * astro_intensity * astro_tint, astro_color.a * astro_mask * bottom_mask);

// Stars

Expand Down

0 comments on commit b87704d

Please sign in to comment.