Skip to content

Commit

Permalink
Merge pull request #93 from post-kerbin-mining-corporation/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ChrisAdderley committed Dec 16, 2021
2 parents 59e86d6 + 0cbacf7 commit 0c77832
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 15 deletions.
File renamed without changes.
Binary file modified GameData/Waterfall/Plugins/Waterfall.dll
Binary file not shown.
Binary file modified GameData/Waterfall/Shaders/waterfallshaders-linux.waterfall
Binary file not shown.
Binary file modified GameData/Waterfall/Shaders/waterfallshaders-macos.waterfall
Binary file not shown.
Binary file modified GameData/Waterfall/Shaders/waterfallshaders-windows.waterfall
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/Waterfall/Versioning/Waterfall.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"MAJOR":0,
"MINOR":7,
"PATCH":0,
"PATCH":1,
"BUILD":0
},
"KSP_VERSION":
Expand Down
5 changes: 4 additions & 1 deletion GameData/Waterfall/WaterfallSettings.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WATERFALL_SETTINGS
{
// show the ingame effect editor or not
ShowEffectEditor = true
ShowEffectEditor = false

// Various debug levels
// Emit module debug messages
Expand Down Expand Up @@ -29,5 +29,8 @@ WATERFALL_SETTINGS
MinimumEffectIntensity = 0.005
// Minimum light intensity before lights are culled
MinimumLightIntensity = 0.05

// If this is false, all additive-type shader will be forced to true additive (one:one) blend mode
EnableLegacyBlendModes = false
}

10 changes: 5 additions & 5 deletions GameData/Waterfall/WaterfallTextures.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ WATERFALL_TEXTURE
}
WATERFALL_TEXTURE
{
name = Flare Cross
name = Cross Flare
path = Waterfall/FX/fx_flaresimple01
description = fx_flaresimple01
}
Expand All @@ -145,13 +145,13 @@ WATERFALL_TEXTURE
}
WATERFALL_TEXTURE
{
name = Round Flare
path = Waterfall/FX/fx_flaresimple-2
description = fx_flaresimple-2
name = Round Flare 1
path = Waterfall/FX/fx_flaresimple02
description = fx_flaresimple02
}
WATERFALL_TEXTURE
{
name = Round Flare
name = Round Flare 2
path = Waterfall/FX/fx_flareglow-1
description = fx_flareglow-1
}
Expand Down
4 changes: 1 addition & 3 deletions Source/ShaderLab/Additive Echo.shader
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

_TileX("Tiling X", Float) = 1
_TileY("Tiling Y", Float) = 1
_SrcMode("SrcMode", Float) = 1
_DestMode("DestMode", Float) = 6

[Space]

Expand All @@ -50,7 +48,7 @@
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" }


Blend[_SrcMode][_DestMode]
Blend one one

ZWrite Off
ZTest LEqual
Expand Down
2 changes: 1 addition & 1 deletion Source/Waterfall/EffectControllers/ThrustController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public override List<float> Get()
{
// Thanks to NathanKell for the formula.
currentThrustFraction = engineController.fuelFlowGui
/ (engineController.maxFuelFlow * 1000f)
/ engineController.maxFuelFlow
/ (float)engineController.ratioSum
* engineController.mixtureDensity
* engineController.multIsp;
Expand Down
6 changes: 5 additions & 1 deletion Source/Waterfall/Effects/WaterfallEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,10 @@ public void Update()

public void SetHDR(bool isHDR)
{
float destMode = 1f;
if (Settings.EnableLegacyBlendModes)
destMode = 6f;

for (int i = 0; i < effectRendererMaterials.Count; i++)
{
if (effectRendererMaterials[i].HasProperty("_DestMode"))
Expand All @@ -843,7 +847,7 @@ public void SetHDR(bool isHDR)
}
else
{
effectRendererMaterials[i].SetFloat("_DestMode", 6f);
effectRendererMaterials[i].SetFloat("_DestMode", destMode);
effectRendererMaterials[i].SetFloat("_ClipBrightness", 1f);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Waterfall/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static class Settings
public static float MinimumLightIntensity = 0.05f;
public static bool EnableLights = true;
public static bool EnableDistortion = true;
public static bool EnableLegacyBlendModes = true;

/// <summary>
/// Load data from configuration
Expand All @@ -70,6 +71,7 @@ public static void Load()
settingsNode.TryGetValue("MinimumLightIntensity", ref MinimumLightIntensity);
settingsNode.TryGetValue("EnableLights", ref EnableLights);
settingsNode.TryGetValue("EnableDistortion", ref EnableDistortion);
settingsNode.TryGetValue("EnableLegacyBlendModes", ref EnableLegacyBlendModes);
}
else
{
Expand Down
7 changes: 5 additions & 2 deletions Source/Waterfall/UI/UIColorPickerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public UIColorPickerWindow(Color colorToEdit, bool show) : base(show)
rainbow = MaterialUtils.GenerateRainbowGradient(120, 20);
aTexture = MaterialUtils.GenerateGradientTexture(100, 20, Color.black, Color.white);
colorField = MaterialUtils.GenerateColorField(colorFieldSize, colorFieldSize, currentHSVColor.ToColor());
if (!showWindow)

WindowPosition = new Rect(Screen.width / 2 - 100, Screen.height / 2f, 210, 100);
}

Expand Down Expand Up @@ -109,7 +109,10 @@ public void ChangeColor(Color colorToEdit)
rainbow = MaterialUtils.GenerateRainbowGradient(120, 20);
aTexture = MaterialUtils.GenerateGradientTexture(100, 20, Color.black, Color.white);
colorField = MaterialUtils.GenerateColorField(colorFieldSize, colorFieldSize, currentHSVColor.ToColor());
showWindow = true;

if (!showWindow)
WindowPosition = new Rect(Screen.width / 2 - 100, Screen.height / 2f, 210, 100);

GUI.BringWindowToFront(windowID);
}

Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.7.1
------
- Changed the default blend mode of all additive-type effects to One One, this is controlled by a new Settings item called EnableLegacyBlendModes
- Fixed the Thrust controller which was not working right (al2me6)
- Fixed material picker texture name throwing an error (al2me6)
- Fixed color editor window being too wide

v0.7.0
------
- New shaders: Waterfall/Additive (Volumetric), Waterfall/Additive Cones (Volumetric), Waterfall/Additive Echo (Dynamic) by KnightOfStJohn
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
===============
Waterfall 0.7.0
Waterfall 0.7.1
===============

Waterfall is a mod for Kerbal Space Program that provides a cool new way to create and drive engine effects for smooth rocket plumes. It has
Expand Down

0 comments on commit 0c77832

Please sign in to comment.