Skip to content

Commit

Permalink
fix #18 ramp map alpha
Browse files Browse the repository at this point in the history
fix #11 ArgumentException
  • Loading branch information
JasonMa0012 committed Feb 27, 2023
1 parent 3869698 commit 33521ed
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Editor/DrawerUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ public static bool CreateAndSaveNewGradientTexture(int width, int height, string
var gradientObject = ScriptableObject.CreateInstance<GradientObject>();
gradientObject.gradient = new Gradient();
gradientObject.gradient.colorKeys = new[] { new GradientColorKey(Color.gray, 0.0f), new GradientColorKey(Color.white, 1.0f) };
gradientObject.gradient.alphaKeys = new[] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) };
gradientObject.gradient.alphaKeys = new[] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 1f) };

var ramp = CreateGradientTexture(gradientObject.gradient, width, height);
var png = ramp.EncodeToPNG();
Expand Down
1 change: 0 additions & 1 deletion Editor/ShaderDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public override void OnGUI(Rect position, MaterialProperty prop, GUIContent labe
MetaDataHelper.RegisterMainProp(lwgui.shader, prop, _group);
MetaDataHelper.RegisterPropertyDefaultValueText(lwgui.shader, prop,
RevertableHelper.GetDefaultProperty(lwgui.shader, prop).floatValue > 0 ? "On" : "Off");
return;
}

string finalGroupName = (_group != String.Empty && _group != "_") ? _group : prop.name;
Expand Down
1 change: 1 addition & 0 deletions Editor/Test/LWGUI_KeywordTest.mat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Material:
serializedVersion: 3
m_TexEnvs: []
m_Floats:
- _ZWrite: 1
- _enum: 1
- _group: 1
- _keywordEnum: 1
Expand Down
1 change: 1 addition & 0 deletions Editor/Test/LWGUI_SampleDrawer 2.mat
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Material:
- _key3_Float4_PowerSlider: 0.0033800516
- _minMaxSlider: 1
- _preset: 0
- _preset1: 0
- _range: 0
- _rangeEnd: 0.7474536
- _rangeStart: 0.24745372
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.jasonma.lwgui",
"version": "1.4.1",
"version": "1.4.2",
"displayName": "LWGUI",
"description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.",
"keywords": [
Expand Down

0 comments on commit 33521ed

Please sign in to comment.