Skip to content

Commit

Permalink
Fix cases where clouds with rim fading are not visible from below (Is…
Browse files Browse the repository at this point in the history
…sue #10).

Fix UVnoise becoming glitchy after a few years of game time.
  • Loading branch information
WazWaz committed Apr 13, 2018
1 parent e1b3f9a commit 356bf60
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Assets/Shaders/SphereCloud.shader
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Shader "EVE/Cloud" {
half detailLevel = saturate(2 * _DetailDist*viewDist);
color = _Color * main.rgba * lerp(detail.rgba, 1, detailLevel);

float rim = saturate(dot(IN.viewDir, IN.worldNormal));
float rim = saturate(abs(dot(IN.viewDir, IN.worldNormal)));
rim = saturate(pow(_FalloffScale*rim,_FalloffPow));
float dist = distance(IN.worldVert,_WorldSpaceCameraPos);
float distLerp = saturate(_RimDist*(distance(_PlanetOrigin,_WorldSpaceCameraPos) - _RimDistSub*distance(IN.worldVert,_PlanetOrigin)));
Expand Down
3 changes: 2 additions & 1 deletion Atmosphere/Clouds2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ internal void UpdateRotation(QuaternionD rotation, Matrix4x4 World2Planet, Matri

Vector4 UniversalTimeVector()
{
float ut = (float)(Planetarium.GetUniversalTime() % (float.MaxValue / 2)); // will cause discontinuity every few thousand years.
// We need to keep within low float exponents.
float ut = (float)(Planetarium.GetUniversalTime() % 1000000); // will cause discontinuity every 46.3 game days.
return new Vector4(ut / 20, ut, ut * 2, ut * 3);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"VERSION": {
"MAJOR": 1,
"MINOR": 4,
"PATCH": 0,
"BUILD": 1
"PATCH": 2,
"BUILD": 2
},
"KSP_VERSION": {
"MAJOR": 1,
Expand Down
Binary file modified Releases/Logo.psd
Binary file not shown.
2 changes: 1 addition & 1 deletion _BuildManager/Properties/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.1")] // KSP version with EVE release number appended.
[assembly: AssemblyVersion("1.4.2.2")] // KSP version with EVE release number appended; see also CKAN version file.

0 comments on commit 356bf60

Please sign in to comment.