Skip to content

Commit

Permalink
Fixes KSP-KOS#2463 by just changing which shader
Browse files Browse the repository at this point in the history
Fixes KSP-KOS#2463

The Shader chosen from KSP's pre-made shaders was one
that was additive-only and would never darken colors.
That's all that was wrong.
  • Loading branch information
Dunbaratu committed Mar 20, 2019
1 parent 3d0c88d commit 84e2297
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/kOS/Suffixed/VectorRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using kOS.Safe;
using kOS.Safe;
using kOS.Safe.Encapsulation;
using kOS.Safe.Encapsulation.Suffixes;
using kOS.Safe.Execution;
Expand Down Expand Up @@ -340,16 +340,18 @@ public void SetShow(BooleanValue newShowVal)

line = lineObj.AddComponent<LineRenderer>();
hat = hatObj.AddComponent<LineRenderer>();
//TODO: 1.1 TODO
label = labelObj.GetComponent<GUIText>();

line.useWorldSpace = false;
hat.useWorldSpace = false;

GetShipCenterCoords();

line.material = new Material(Shader.Find("Particles/Additive"));
hat.material = new Material(Shader.Find("Particles/Additive"));
// Note the Shader name string below comes from Kerbal's packaged shaders the
// game ships with - there's many to choose from but they're not documented what
// they are. This was settled upon via trial and error:
line.material = new Material(Shader.Find("Particles/Alpha Blended"));
hat.material = new Material(Shader.Find("Particles/Alpha Blended"));

// This is how font loading would work if other fonts were available in KSP:
// Font lblFont = (Font)Resources.Load( "Arial", typeof(Font) );
Expand Down

0 comments on commit 84e2297

Please sign in to comment.