Update comments, apply brightness -- which had been mistakenly removed
This commit is contained in:
@@ -41,8 +41,16 @@ void fragment() {
|
|||||||
// 1 = more stars
|
// 1 = more stars
|
||||||
// we add shift and speed to the uv value, and apply a simple parallax equation
|
// we add shift and speed to the uv value, and apply a simple parallax equation
|
||||||
// in order to get movement (as defined by the vec2 `speed`
|
// in order to get movement (as defined by the vec2 `speed`
|
||||||
stars += pow(texture(noise_texture, uv + shift + speed * (1.0 - float(i) * 0.1)).r, density);
|
stars += pow(texture(noise_texture, uv + shift + speed * (1.0 - float(i) * 0.1)).r, density) * brightness;
|
||||||
|
// convert this into a vec3
|
||||||
new_stars = vec3(stars);
|
new_stars = vec3(stars);
|
||||||
|
// using the y value of the UV coordinates, we can thereby
|
||||||
|
// do a "random" function on that y value
|
||||||
|
// (as we wont apply a vertical motion to this field).
|
||||||
|
// from there, we can set the "ratios" of different stars, depending on the y value of the
|
||||||
|
// 'star' as it moves horizontally (delta(y) = 0)
|
||||||
|
// ---
|
||||||
|
// in theory, we can give each star a quasi-unique color by applying the same logic, and setting the RGB values accordingly
|
||||||
if (rand_y(uv) >= upper_tolerance_for_star_color){
|
if (rand_y(uv) >= upper_tolerance_for_star_color){
|
||||||
new_stars.g -= 0.2;
|
new_stars.g -= 0.2;
|
||||||
new_stars.r -= 1.0;
|
new_stars.r -= 1.0;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ noise = SubResource("FastNoiseLite_mfsqn")
|
|||||||
shader = ExtResource("2_mfsqn")
|
shader = ExtResource("2_mfsqn")
|
||||||
shader_parameter/resolution = Vector2(1270, 720)
|
shader_parameter/resolution = Vector2(1270, 720)
|
||||||
shader_parameter/noise_texture = SubResource("NoiseTexture2D_2bx6i")
|
shader_parameter/noise_texture = SubResource("NoiseTexture2D_2bx6i")
|
||||||
shader_parameter/density = 20.0
|
shader_parameter/density = 31.40000045299648
|
||||||
shader_parameter/speed_x = 0.005
|
shader_parameter/speed_x = 0.005
|
||||||
shader_parameter/speed_y = 0.0
|
shader_parameter/speed_y = 0.0
|
||||||
shader_parameter/layers = 5.0
|
shader_parameter/layers = 5.0
|
||||||
|
|||||||
Reference in New Issue
Block a user