Skip to content

Commit

Permalink
Smoother star transition
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralhalo committed Jun 18, 2022
1 parent 6bf391a commit 7057844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/lumi/shaders/common/contrast.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ const float USER_ALBEDO_BRIGHTENING = clamp(ALBEDO_BRIGHTENING, 0, 20) /
const float EMISSIVE_LIGHT_STR = DEF_EMISSIVE_LIGHT_STR;
const float LIGHTNING_FLASH_STR = DEF_LIGHTNING_FLASH_STR;
// spaghetti
const float STAR_LUMIGATE_HIGH = max(lightLuminance(DEF_DAY_SKY_COLOR) * 0.4, lightLuminance(DEF_NIGHT_SKY_COLOR) + 0.1) * DEF_SKY_STR;
const float STAR_LUMIGATE_LOW = max(STAR_LUMIGATE_HIGH * 0.26, lightLuminance(DEF_NIGHT_SKY_COLOR)) * DEF_SKY_STR;
const float STAR_LUMIGATE_HIGH = max(lightLuminance(DEF_DAY_SKY_COLOR) * 0.4, lightLuminance(DEF_NIGHT_SKY_COLOR) * 1.1) * DEF_SKY_STR;
const float STAR_LUMIGATE_LOW = lightLuminance(DEF_NIGHT_SKY_COLOR) * DEF_SKY_STR;
3 changes: 2 additions & 1 deletion assets/lumi/shaders/prog/sky.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ vec4 customSky(sampler2D sunTexture, sampler2D moonTexture, vec3 toSky, vec3 fal
// Stars
const vec3 NON_MILKY_AXIS = vec3(-0.598964, 0.531492, 0.598964);

float starry = l2_clampScale(STAR_LUMIGATE_HIGH, STAR_LUMIGATE_LOW, lightLuminance(result.rgb));
float starGate = l2_clampScale(STAR_LUMIGATE_HIGH, STAR_LUMIGATE_LOW, lightLuminance(result.rgb));
float starry = starGate * starGate;
starry *= l2_clampScale(-0.6, -0.5, skyDotUp); //prevent star near the void core

float milkyness = l2_clampScale(0.7, 0.0, abs(dot(NON_MILKY_AXIS, toSky.xyz)));
Expand Down

0 comments on commit 7057844

Please sign in to comment.