Skip to content

Commit 1a3aeef

Browse files
committed
Fix issues/discontinuities in the simplex noise applied for the editor dissolve effect
1 parent d591e33 commit 1a3aeef

3 files changed

Lines changed: 148 additions & 137 deletions

File tree

DeferredKSP/Deferred.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System;
66
using UnityEngine.SceneManagement;
77

8-
[assembly: AssemblyVersion("1.3.3")]
8+
[assembly: AssemblyVersion("1.3.4")]
99
[assembly: KSPAssemblyDependency("0Harmony", 0, 0)]
1010
[assembly: KSPAssemblyDependency("Shabby", 0, 0)]
1111
namespace Deferred

shaders/DeferredKSPShaders/Assets/Shaders/Replaced shaders/Dissolve.cginc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ void DissolveClip(float3 pos, float alpha)
55
[branch]
66
if (alpha > 0.99)
77
return;
8-
9-
pos = pos * 2.0 + 300.0.xxx; // Noise has discontinuity around zero so offset away from it
10-
11-
float noise = snoise(pos) * 0.5 + 0.5;
8+
9+
float noise = snoise(pos * 2.0) * 0.5 + 0.5;
1210

1311
alpha = saturate((alpha - 0.2) / 0.8);
1412

0 commit comments

Comments
 (0)