Skip to content

Commit

Permalink
Merge pull request #4 from noridev/develop
Browse files Browse the repository at this point in the history
Release: 1.1.0
  • Loading branch information
noridev authored Sep 25, 2024
2 parents 26e08f8 + ecc9480 commit f9a314e
Show file tree
Hide file tree
Showing 14 changed files with 8,098 additions and 6,822 deletions.
54 changes: 50 additions & 4 deletions CHANGELOG_NRDV.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
## [1.x.x] - 2024-x-x
기반 LightLimitChanger 버전: <b>1.x.x</b>
### Added
-
### Changed
-
### Deprecated
-
### Removed
-
### Fixed
-
---
-->

## [1.1.0] - 2024-09-25
기반 LightLimitChanger 버전: <b>1.14.0</b>

### Added
- 그림자 조정 기능 추가
- 환경광에 의한 그림자 색을 조정할 수 있음

### Changed
- Poiyomi Toon 셰이더 업데이트 (<small>9.0.56</small> -> 9.0.61)

---

## [1.0.4] - 2024-09-03
기반 LightLimitChanger 버전: <b>1.14.0</b>

Expand All @@ -20,16 +55,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.2] - 2024-08-25
기반 LightLimitChanger 버전: <b>1.13.2</b>

### Changes
- Prefab 업데이트

### Added
- 원본 LLC와 구분할 수 있도록 패치 네임 추가

### Changed
- Prefab 업데이트

---

## [1.0.1] - 2024-08-25
기반 LightLimitChanger 버전: <b>1.13.2</b>

### Changes
### Changed
- Add: 한국어(ko-KR) 지원

---

## [1.0.0] - 2024-08-24
기반 LightLimitChanger 버전: <b>1.13.2</b>

### Added
- Feat: Monochrome과 Monochrome Additive 설정을 분리하도록 변경(Poiyomi 전용)

### Changed
- LLC가 비활성화 상태일 때 Monochrome 값을 머티리얼의 기본값으로 설정
4 changes: 3 additions & 1 deletion Editor/ControlAnimationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ public readonly struct ControlAnimationParameters
public readonly float DefaultMaxLightValue;
public readonly float DefaultMonochromeLightingValue;
public readonly float DefaultMonochromeAdditiveLightingValue;
public readonly float DefaultShadowEnvStrengthValue;

public ControlAnimationParameters(string targetPath, Type targetType, float minLightValue, float maxLightValue, float defaultMinLightValue, float defaultMaxLightValue, float defaultMonochromeLightingValue, float defaultMonochromeAdditiveLightingValue)
public ControlAnimationParameters(string targetPath, Type targetType, float minLightValue, float maxLightValue, float defaultMinLightValue, float defaultMaxLightValue, float defaultMonochromeLightingValue, float defaultMonochromeAdditiveLightingValue, float defaultShadowEnvStrengthValue)
{
TargetPath = targetPath;
TargetType = targetType;
Expand All @@ -24,6 +25,7 @@ public ControlAnimationParameters(string targetPath, Type targetType, float minL
DefaultMaxLightValue = defaultMaxLightValue;
DefaultMonochromeLightingValue = defaultMonochromeLightingValue;
DefaultMonochromeAdditiveLightingValue = defaultMonochromeAdditiveLightingValue;
DefaultShadowEnvStrengthValue = defaultShadowEnvStrengthValue;
}
}
}
16 changes: 14 additions & 2 deletions Editor/LightLimitChangerSettingsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ internal sealed class LightLimitChangerSettingsEditor : Editor
private SerializedProperty AllowMonochromeControl;
private SerializedProperty AllowUnlitControl;
private SerializedProperty AllowEmissionControl;
private SerializedProperty AllowShadowControl;
private SerializedProperty InitialTempControlValue;
private SerializedProperty InitialSaturationControlValue;
private SerializedProperty InitialMonochromeControlValue;
Expand All @@ -33,6 +34,7 @@ internal sealed class LightLimitChangerSettingsEditor : Editor
private SerializedProperty Excludes;
private SerializedProperty WriteDefaults;
private SerializedProperty MonochromeAdditiveLightingValue;
private SerializedProperty ShadowEnvStrengthValue;

private static bool _isOptionFoldoutOpen = true;
private static bool _isCepareteInitValFoldoutOpen = false;
Expand All @@ -59,6 +61,7 @@ private void OnEnable()
AllowMonochromeControl = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.AllowMonochromeControl));
AllowUnlitControl = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.AllowUnlitControl));
AllowEmissionControl = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.AllowEmissionControl));
AllowShadowControl = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.AllowShadowControl));
InitialTempControlValue = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.InitialTempControlValue));
InitialSaturationControlValue = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.InitialSaturationControlValue));
InitialMonochromeControlValue = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.InitialMonochromeControlValue));
Expand All @@ -70,6 +73,7 @@ private void OnEnable()
Excludes = serializedObject.FindProperty(nameof(LightLimitChangerSettings.Excludes));
WriteDefaults = serializedObject.FindProperty(nameof(LightLimitChangerSettings.WriteDefaults));
MonochromeAdditiveLightingValue = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.MonochromeAdditiveLightingValue));
ShadowEnvStrengthValue = parameters.FindPropertyRelative(nameof(LightLimitChangerParameters.ShadowEnvStrengthValue));
}

public override void OnInspectorGUI()
Expand Down Expand Up @@ -159,6 +163,8 @@ public override void OnInspectorGUI()
Localization.G("label.allow_color_tmp", "tip.allow_color_tmp"));
EditorGUILayout.PropertyField(AllowSaturationControl,
Localization.G("label.allow_saturation", "tip.allow_saturation"));
EditorGUILayout.PropertyField(AllowShadowControl,
Localization.G("label.allow_shadow", "tip.allow_shadow"));
EditorGUILayout.PropertyField(AllowMonochromeControl,
Localization.G("label.allow_monochrome", "tip.allow_monochrome"));
EditorGUI.BeginDisabledGroup(AllowMonochromeControl.boolValue == false);
Expand Down Expand Up @@ -194,7 +200,14 @@ public override void OnInspectorGUI()
EditorGUI.BeginDisabledGroup(AllowSaturationControl.boolValue == false);
EditorGUILayout.PropertyField(InitialSaturationControlValue, Localization.G(""));
EditorGUI.EndDisabledGroup();

}
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.Space(10);
EditorGUILayout.LabelField(Localization.G("label.shadow_env_strength"), GUILayout.MaxWidth(70.0f), GUILayout.ExpandWidth(false));
EditorGUI.BeginDisabledGroup(AllowShadowControl.boolValue == false);
EditorGUILayout.PropertyField(ShadowEnvStrengthValue, Localization.G(""));
EditorGUI.EndDisabledGroup();
}
using (new EditorGUILayout.HorizontalScope())
{
Expand All @@ -204,7 +217,6 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(InitialMonochromeControlValue, Localization.G(""));
EditorGUI.EndDisabledGroup();
}

using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.Space(10);
Expand Down
3 changes: 2 additions & 1 deletion Editor/LightLimitControlType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public enum LightLimitControlType : long
Monochrome = 1 << 6,
MonochromeAdditive = 1 << 7,
Emission = 1 << 8,
ShadowEnvStrength = 1 << 9,

AdditionalControls = Saturation | Unlit | ColorTemperature | Monochrome | MonochromeAdditive | Emission,
AdditionalControls = Saturation | Unlit | ColorTemperature | Monochrome | MonochromeAdditive | Emission | ShadowEnvStrength,
}
}
40 changes: 40 additions & 0 deletions Editor/Localization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ internal static class Localization
"채도 조정 활성화"
}
},
{
"label.allow_shadow", new []
{
"Enable Unlit Control",
"影調整を有効にする",
"啟用陰影控制",
"启用陰影控制",
"그림자 조정 활성화"
}
},
{
"label.allow_monochrome", new []
{
Expand Down Expand Up @@ -375,6 +385,16 @@ internal static class Localization
"채도"
}
},
{
"label.shadow_env_strength", new []
{
"Shadow Environment Strength",
"環境光",
"環境迷",
"环境迷",
"환경광에 의한 그림자 색"
}
},
{
"label.monochrome", new []
{
Expand Down Expand Up @@ -640,6 +660,16 @@ internal static class Localization
"채도 조정 기능을 활성화할 수 있습니다"
}
},
{
"tip.allow_shadow", new []
{
"Enables shadow adjustment functionality",
"影の調整機能を有効化することができます",
"啟用陰影度調整功能",
"启用陰影度调整功能",
"그림자 조정 기능을 활성화할 수 있습니다"
}
},
{
"tip.allow_monochrome", new []
{
Expand Down Expand Up @@ -987,6 +1017,16 @@ 최신 버전의 Poiyomi Shader로 업데이트 해야 기능을 정상적으로
"채도"
}
},
{
"ExpressionMenu.shadow_env_strength", new []
{
"Shadow Env Strength",
"環境光",
"環境迷",
"环境迷",
"환경광"
}
},
{
"ExpressionMenu.unlit", new []
{
Expand Down
3 changes: 3 additions & 0 deletions Editor/NDMF/ParameterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public IEnumerable<ProvidedParameter> GetSuppliedParameters(BuildContext context
if (parameters.AllowSaturationControl)
yield return Parameter<float>(Passes.ParameterName_Saturation);

if (parameters.AllowShadowControl)
yield return Parameter<float>(Passes.ParameterName_ShadowEnvStrength);

if (parameters.AllowMonochromeControl)
{
yield return Parameter<float>(Passes.ParameterName_Monochrome);
Expand Down
8 changes: 5 additions & 3 deletions Editor/NDMF/Passes.GenerateAnimationsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ internal static void Run(Session session, LightLimitChangerObjectCache cache)
var min = parameters.MinLightValue;
var max = parameters.MaxLightValue;

float defaultMinLight, defaultMaxLight, defaultMonochromeLighting, defaultMonochromeAdditiveLighting;
float defaultMinLight, defaultMaxLight, defaultMonochromeLighting, defaultMonochromeAdditiveLighting, defaultShadowEnvStrength;
if (!parameters.OverwriteDefaultLightMinMax &&
renderer.sharedMaterial is Material mat &&
x.IsTargetShader(mat?.shader) &&
x.TryGetLightMinMaxValue(mat, out defaultMinLight, out defaultMaxLight) &&
x.TryGetMonochromeValue(mat, out defaultMonochromeLighting, out defaultMonochromeAdditiveLighting))
x.TryGetMonochromeValue(mat, out defaultMonochromeLighting, out defaultMonochromeAdditiveLighting) &&
x.TryGetShadowEnvStrengthValue(mat, out defaultShadowEnvStrength))
{
// OverwriteDefaultLightMinMax disabled.
// Now we get defaultMinLight and defaultMaxLight from first material slot.
Expand All @@ -52,6 +53,7 @@ renderer.sharedMaterial is Material mat &&
{
defaultMonochromeLighting = parameters.InitialMonochromeControlValue;
defaultMonochromeAdditiveLighting = parameters.MonochromeAdditiveLightingValue;
defaultShadowEnvStrength = parameters.ShadowEnvStrengthValue;

if (parameters.IsSeparateLightControl)
{
Expand All @@ -67,7 +69,7 @@ renderer.sharedMaterial is Material mat &&
}
}

var param = new ControlAnimationParameters(relativePath, type, min, max, defaultMinLight, defaultMaxLight, defaultMonochromeLighting, defaultMonochromeAdditiveLighting);
var param = new ControlAnimationParameters(relativePath, type, min, max, defaultMinLight, defaultMaxLight, defaultMonochromeLighting, defaultMonochromeAdditiveLighting, defaultShadowEnvStrength);
foreach (ref readonly var container in animationContainers)
{
x.SetControlAnimation(container, param, parameters);
Expand Down
7 changes: 7 additions & 0 deletions Editor/NDMF/Passes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static void RunningPasses(Sequence sequence)
internal const string ParameterName_Reset = "LightLimitReset";
internal const string ParameterName_Monochrome = "LightLimitMonochrome";
internal const string ParameterName_MonochromeAdditive = "LightLimitMonochromeAdditive";
internal const string ParameterName_ShadowEnvStrength = "LightLimitShadowEnvStrength";

private static Session GetSession(BuildContext context)
{
Expand Down Expand Up @@ -163,6 +164,12 @@ public void InitializeSession(LightLimitChangerSettings settings, LightLimitChan
controls.Add(ControlAnimationContainer.Create(LightLimitControlType.Emission, Localization.S("ExpressionMenu.emission"), "Emission", ParameterName_Emission, 1.0f, Icons.Emission, defaultAnimation));
}

if (parameters.AllowShadowControl)
{
targetControl |= LightLimitControlType.ShadowEnvStrength;
controls.Add(ControlAnimationContainer.Create(LightLimitControlType.ShadowEnvStrength, Localization.S("ExpressionMenu.shadow_env_strength"), "Shadow Environment Strength", ParameterName_ShadowEnvStrength, parameters.ShadowEnvStrengthValue, Icons.Unlit, defaultAnimation));
}


Controls = controls.ToArray();

Expand Down
Loading

0 comments on commit f9a314e

Please sign in to comment.