Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit f6285ce

Browse files
committed
Merge branch 'dev'
2 parents 19f2604 + 8db786d commit f6285ce

File tree

5 files changed

+36
-13
lines changed

5 files changed

+36
-13
lines changed

Editor/FreeImage/FreeImagePackingEditor.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,15 @@ public void OnGUI()
185185
{
186186
var texture = AssetDatabase.LoadAssetAtPath<Texture2D>(unityPath);
187187
_packingMaterial.SetTexture(_packingProperty.name, texture);
188-
LitGUI.ApplyChanges(_packingMaterial);
188+
if (_packingMaterial.shader.name == ProjectSettings.ShaderName)
189+
{
190+
LitGUI.ApplyChanges(_packingMaterial);
191+
}
192+
else
193+
{
194+
DefaultInspector.RequestValidate();
195+
}
196+
MaterialEditor.ApplyMaterialPropertyDrawers(_packingMaterial);
189197
}
190198
}
191199
EditorGUILayout.EndHorizontal();

Editor/Importer/LitImporterDefaultProperties.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ [ToggleGroupEnd] [UnIndent] [ToggleOff] _OpaqueLights(""Opaque Lights"", Float)
3232

3333
public const string DefaultConfigFile = @"
3434
DEFINES_START
35-
// #define BAKERY_MONOSH // enable mono sh globally
35+
// comment out to set globally
36+
37+
// #define BAKERY_MONOSH // enable mono
38+
// #define _LIGHTMAPPED_SPECULAR // enable lightmapped specular
39+
// #undef APPROXIMATE_AREALIGHT_SPECULAR // lower the smoothness in areas where theres less directionality in directional lightmaps, defined by default
40+
// #define BICUBIC_LIGHTMAP // enable bicubic lightmap
41+
// #define BAKERY_SHNONLINEAR_OFF // disable non linear lightmap sh, enabled by default
42+
// #define NONLINEAR_LIGHTPROBESH // enable non linear lightprobe sh
43+
// #define DISABLE_LIGHT_PROBE_PROXY_VOLUME // enable LPPV
44+
// #undef UNITY_SPECCUBE_BLENDING // disable blending of 2 reflection probes
3645
DEFINES_END
3746
3847
";

Editor/Inspector/DefaultInspector.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] mat
5151
materialEditor.EnableInstancingField();
5252
materialEditor.DoubleSidedGIField();
5353

54-
if (EditorGUI.EndChangeCheck())
54+
if (EditorGUI.EndChangeCheck() || _requestValidate)
5555
{
5656
OnValidate(materialEditor, materialProperties);
57+
_requestValidate = false;
5758
}
5859
}
59-
60+
private static bool _requestValidate = false;
61+
public static void RequestValidate() => _requestValidate = true;
6062
private void OnValidate(MaterialEditor materialEditor, MaterialProperty[] materialProperties)
6163
{
6264
foreach (Material mat in materialEditor.targets)
@@ -258,15 +260,18 @@ private void InitializeEditor(MaterialEditor materialEditor, MaterialProperty[]
258260
rect = MaterialEditor.GetRectAfterLabelWidth(rect);
259261
rect.width = 50;
260262
//rect.position = new Vector2(Screen.width / 2, rect.position.y);
261-
if (GUI.Button(rect, "Pack"))
263+
if (editor.targets.Length == 1)
262264
{
263-
FreeImagePackingEditor.Init();
264-
FreeImagePackingEditor.ChannelR.DisplayName = rName;
265-
FreeImagePackingEditor.ChannelG.DisplayName = gName;
266-
FreeImagePackingEditor.ChannelB.DisplayName = bName;
267-
FreeImagePackingEditor.ChannelA.DisplayName = aName;
268-
FreeImagePackingEditor.Linear = isLinear;
269-
FreeImagePackingEditor.AddPackingMaterial((Material)editor.target, unityProperty[property.index]);
265+
if (GUI.Button(rect, "Pack"))
266+
{
267+
FreeImagePackingEditor.Init();
268+
FreeImagePackingEditor.ChannelR.DisplayName = rName;
269+
FreeImagePackingEditor.ChannelG.DisplayName = gName;
270+
FreeImagePackingEditor.ChannelB.DisplayName = bName;
271+
FreeImagePackingEditor.ChannelA.DisplayName = aName;
272+
FreeImagePackingEditor.Linear = isLinear;
273+
FreeImagePackingEditor.AddPackingMaterial((Material)editor.target, unityProperty[property.index]);
274+
}
270275
}
271276
};
272277
}

Shaders/Lit.litshader

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ PROPERTIES_START // Properties
4242
FoldoutMainEnd_PropertiesLocal ("", Float) = 0
4343

4444
FoldoutMainStart_Details ("Details", Float) = 0
45+
[TexturePacking(Abledo R, Albedo G, Albedo B, Mask, false)]
4546
[NoScaleOffset] [Toggle(_DETAIL_ALBEDO)] [Tooltip(Albedo (RGB), Mask (A))] [ExtraProperty] _DetailAlbedo ("Detail Albedo", 2D) = "white" {}
4647
[Enum(Multiply X2, 0, Overlay, 1, Screen, 3)] [Indent] [UnIndent] _DetailAlbedoBlendMode ("Blend Mode", Int) = 0
4748
[NoScaleOffset] [Normal] [Toggle(_DETAIL_NORMAL)] [ExtraProperty] _DetailBumpMap ("Detail Normal Map", 2D) = "bump" {}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.z3y.shaders",
33
"description": "A Standard Shader and Surface Shaders replacement for Unity for Built-In pipeline and forward rendering (VRChat)",
4-
"version": "3.2.2",
4+
"version": "3.2.3",
55
"unity": "2019.4",
66
"displayName": "z3y - Shaders",
77
"hideInEditor": false,

0 commit comments

Comments
 (0)