Skip to content

Commit

Permalink
Fix flickering clouds in reflection probe
Browse files Browse the repository at this point in the history
  • Loading branch information
LGhassen committed Dec 11, 2021
1 parent c0cc608 commit 6935055
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Assets/Shaders/SphereCloud.shader
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ Shader "EVE/Cloud" {
half4 scolor = SpecularColorLight(_WorldSpaceLightPos0, IN.viewDir, worldNormal, color, 0, 0, LIGHT_ATTENUATION(IN));
scolor *= Terminator(normalize(_WorldSpaceLightPos0), worldNormal);
scolor.a = transparency;

#ifdef SOFT_DEPTH_ON
float partZ = IN.projPos.z;

Expand All @@ -223,7 +224,7 @@ Shader "EVE/Cloud" {
float fade = saturate(_InvFade * 0.1 * (terrainLength - viewLength));

fade = lerp(fade,1.0, smoothstep (50000.0, 100000.0, viewLength)); //fade out soft depth at large distances

fade = (_ProjectionParams.y < 1.0 && _ProjectionParams.z > 1000 && _ProjectionParams.z < 200000) ? 1.0 : fade; //HACK to disable soft-depth on reflection probe which causes flickering
scolor.a *= fade;
#endif
scolor.rgb *= MultiBodyShadow(IN.worldVert, _SunRadius, _SunPos, _ShadowBodies);
Expand All @@ -238,7 +239,6 @@ Shader "EVE/Cloud" {
#if !(SHADER_API_D3D11 && WORLD_SPACE_ON) //fixes clouds fading into the planet when zooming out
OUT.depth = (1.0 - depthWithOffset * _ZBufferParams.w) / (depthWithOffset * _ZBufferParams.z);
#endif

return OUT;
}
ENDCG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"VERSION": {
"MAJOR": 1,
"MINOR": 11,
"PATCH": 5,
"PATCH": 6,
"BUILD": 1
},
"KSP_VERSION": {
Expand Down
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.11.5.1")] // KSP version with EVE release number appended; see also CKAN version file.
[assembly: AssemblyVersion("1.11.6.1")] // KSP version with EVE release number appended; see also CKAN version file.
3 changes: 2 additions & 1 deletion _BuildManager/_BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ private void AddLoadingTips()
string[] newTips = {
"Inserting Head Into Clouds...", // How KSP makes us all feel.
"Luminously Urbanizing...", // City lights
"Searching for the Aurora Borealis...", "Searching for the Aurora Australis..." // You'll find them in SVE!
"Searching for the Aurora Borealis...", "Searching for the Aurora Australis...", // You'll find them in SVE!
"Reduxing EVE..."
};
Array.Resize(ref tips, tips.Length + newTips.Length);
newTips.CopyTo(tips, tips.Length - newTips.Length);
Expand Down

0 comments on commit 6935055

Please sign in to comment.