Skip to content

Commit

Permalink
1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lilxyzw committed Oct 19, 2021
1 parent d42eed0 commit 76d95cc
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 10 deletions.
11 changes: 10 additions & 1 deletion Assets/lilToon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ 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.2.2] - 2021-10-18
### Added
- Add a button to change lighting settings with one click

### Fixed
- Fixed an issue where MatCap's custom normal map was not working
- Fixed an issue with tessellation splitting at long range
- Fixed an issue where some properties might not be scanned in the auto shader setting

## [1.2.1] - 2021-10-17
### Fixed
- Fixed an issue where the fur length property was not working
- Fix log date
- Fixed log date

## [1.2.0] - 2021-10-17
### Added
Expand Down
9 changes: 9 additions & 0 deletions Assets/lilToon/CHANGELOG_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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.2.2] - 2021-10-18
### 追加
- ライティングの設定をワンクリックで切り替える機能の追加

### 修正
- マットキャップのカスタムノーマルマップが機能していなかった問題の修正
- 遠距離でテッセレーションの分割が入る問題の修正
- シェーダーの自動設定で一部プロパティがスキャンされない可能性があった問題の修正

## [1.2.1] - 2021-10-17
### 修正
- ファーの長さプロパティが機能していなかった問題の修正
Expand Down
3 changes: 3 additions & 0 deletions Assets/lilToon/Editor/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ sMonochromeLighting Monochrome Lighting ライトのモノクロ化 Monochrome L
sLightDirectionOverride Light Direction Override ライト方向のオーバーライド Light Direction Override Light Direction Override Light Direction Override
sDirectionalLightStrength [HDRP] Directional Light Strength [HDRP] Directional Lightの強さ [HDRP] Directional Light Strength [HDRP] Directional Light Strength [HDRP] Directional Light Strength
sBeforeExposureLimit [HDRP] Before exposure limit [HDRP] Before exposure limit [HDRP] Before exposure limit [HDRP] Before exposure limit [HDRP] Before exposure limit
sLightingPreset Apply Preset プリセットを適用 프리셋 적용 应用预设 應用預設
sLightingPresetDefault Default 通常 디폴트 通常 通常
sLightingPresetStable Stable 安定 안정 稳定 穩定
sHelpRenderingTransparent When two transparent materials overlap, one of them may become invisible. 透過マテリアル同士が重なったときに片方が見えなくなる場合があります 투명 Material끼리 겹친 때 한쪽이 보이지 않을 수 있습니다 当两个透明Material重叠时,其中一个可能会变得不可见。 當兩個透明Material重疊時,其中一個可能會變得不可見。
sHelpOnePassVertexLight When using One Pass / Two Pass Transparent, it is recommended to set Vertex Light Strength to 1.0. 1パス・2パス使用時は頂点ライトの強度を1.0にしておくことをオススメします。 One Pass / Two Pass Transparent 사용 시에는 Vertex Light Strength를 1.0으로 설정할 것을 권장합니다. 使用One Pass/Two Pass Transparent时推荐将Vertex Light Strength设定为1.0。 使用One Pass/Two Pass Transparent時推薦將Vertex Light Strength設定為1.0。
sHelpCullMode If the material does not look right, set the CullMode to Off or Back. 表示がおかしい場合はCullModeをOffもしくはBackにしてください 표시가 이상한 경우는 CullMode을 Off 또는 Back합니다 如果材质看起来不对,请将CullMode设置为Off或Back。 如果材質看起來不對,請將CullMode設置為Off或Back。
Expand Down
45 changes: 43 additions & 2 deletions Assets/lilToon/Editor/lilInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,16 @@ public enum lilPropertyBlock
Tessellation
}

public enum lilLightingPreset
{
Default,
Stable
}

//------------------------------------------------------------------------------------------------------------------------------
// Constant
private const string currentVersionName = "1.2.1";
private const int currentVersionValue = 14;
private const string currentVersionName = "1.2.2";
private const int currentVersionValue = 15;

private const string boothURL = "https://lilxyzw.booth.pm/";
private const string githubURL = "https://github.com/lilxyzw/lilToon";
Expand Down Expand Up @@ -7534,6 +7540,29 @@ private void ResetProperties(lilPropertyBlock propertyBlock)
}
}

private void ApplyLightingPreset(lilLightingPreset lightingPreset)
{
switch(lightingPreset)
{
case lilLightingPreset.Default:
if(asUnlit != null) asUnlit.floatValue = 0.0f;
if(vertexLightStrength != null) vertexLightStrength.floatValue = 0.0f;
if(lightMinLimit != null) lightMinLimit.floatValue = 0.0f;
if(lightMaxLimit != null) lightMaxLimit.floatValue = 1.0f;
if(monochromeLighting != null) monochromeLighting.floatValue = 0.0f;
if(shadowEnvStrength != null) shadowEnvStrength.floatValue = 0.0f;
break;
case lilLightingPreset.Stable:
if(asUnlit != null) asUnlit.floatValue = 0.0f;
if(vertexLightStrength != null) vertexLightStrength.floatValue = 0.0f;
if(lightMinLimit != null) lightMinLimit.floatValue = 0.05f;
if(lightMaxLimit != null) lightMaxLimit.floatValue = 1.0f;
if(monochromeLighting != null) monochromeLighting.floatValue = 0.5f;
if(shadowEnvStrength != null) shadowEnvStrength.floatValue = 0.0f;
break;
}
}

//------------------------------------------------------------------------------------------------------------------------------
// Material Setup
internal static void SetupMaterialWithRenderingMode(Material material, RenderingMode renderingMode, TransparentMode transparentMode, bool isoutl, bool islite, bool isstencil, bool istess)
Expand Down Expand Up @@ -7973,6 +8002,9 @@ internal static void SetupShaderSettingFromMaterial(Material material, ref lilTo
if(material.HasProperty("_RimColorTex")) shaderSetting.LIL_FEATURE_TEX_RIMLIGHT_COLOR = shaderSetting.LIL_FEATURE_TEX_RIMLIGHT_COLOR || material.GetTexture("_RimColorTex") != null;
if(material.HasProperty("_AudioLinkMask")) shaderSetting.LIL_FEATURE_TEX_AUDIOLINK_MASK = shaderSetting.LIL_FEATURE_TEX_AUDIOLINK_MASK || material.GetTexture("_AudioLinkMask") != null;
if(material.HasProperty("_DissolveNoiseMask")) shaderSetting.LIL_FEATURE_TEX_DISSOLVE_NOISE = shaderSetting.LIL_FEATURE_TEX_DISSOLVE_NOISE || material.GetTexture("_DissolveNoiseMask") != null;

shaderSetting.LIL_FEATURE_EMISSION_UV = shaderSetting.LIL_FEATURE_EMISSION_UV || shaderSetting.LIL_FEATURE_ANIMATE_EMISSION_UV;
shaderSetting.LIL_FEATURE_EMISSION_MASK_UV = shaderSetting.LIL_FEATURE_EMISSION_MASK_UV || shaderSetting.LIL_FEATURE_ANIMATE_EMISSION_MASK_UV;
}

// Outline
Expand Down Expand Up @@ -8929,6 +8961,15 @@ private void DrawLightingSettings(MaterialEditor materialEditor)
materialEditor.ShaderProperty(monochromeLighting, GetLoc("sMonochromeLighting"));
materialEditor.ShaderProperty(lightDirectionOverride, GetLoc("sLightDirectionOverride"));
if(shadowEnvStrength != null) materialEditor.ShaderProperty(shadowEnvStrength, GetLoc("sShadowEnvStrength"));
GUILayout.BeginHorizontal();
Rect position2 = EditorGUILayout.GetControlRect();
Rect labelRect = new Rect(position2.x, position2.y, EditorGUIUtility.labelWidth, position2.height);
Rect buttonRect1 = new Rect(labelRect.x + labelRect.width, position2.y, (position2.width - EditorGUIUtility.labelWidth)*0.5f, position2.height);
Rect buttonRect2 = new Rect(buttonRect1.x + buttonRect1.width, position2.y, buttonRect1.width, position2.height);
EditorGUI.PrefixLabel(labelRect, new GUIContent(GetLoc("sLightingPreset")));
if(GUI.Button(buttonRect1, new GUIContent(GetLoc("sLightingPresetDefault")))) ApplyLightingPreset(lilLightingPreset.Default);
if(GUI.Button(buttonRect2, new GUIContent(GetLoc("sLightingPresetStable")))) ApplyLightingPreset(lilLightingPreset.Stable);
GUILayout.EndHorizontal();
EditorGUI.indentLevel--;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.2.0
Version 1.2.2

# Overview
This shader is developed for services using avatars (VRChat, etc.) and has the following features.
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/README_JP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.2.0
Version 1.2.2

# 概要
アバターを用いたサービス(VRChat等)向けに開発したシェーダーで以下のような特徴があります。
Expand Down
2 changes: 0 additions & 2 deletions Assets/lilToon/Shader/Includes/lil_common_frag.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ void lilGetShading(
matcapNormalDirection = normalize(mul(normalmap, tbnWS));
matcapNormalDirection = facing < (_FlipNormal-1.0) ? -matcapNormalDirection : matcapNormalDirection;
}
else
#endif
matUV = lilCalcMatCapUV(matcapNormalDirection, viewDirection, headDirection, _MatCapVRParallaxStrength, _MatCapZRotCancel);
float4 matCapColor = _MatCapColor;
Expand Down Expand Up @@ -946,7 +945,6 @@ void lilGetShading(
matcap2ndNormalDirection = normalize(mul(normalmap, tbnWS));
matcap2ndNormalDirection = facing < (_FlipNormal-1.0) ? -matcap2ndNormalDirection : matcap2ndNormalDirection;
}
else
#endif
mat2ndUV = lilCalcMatCapUV(matcap2ndNormalDirection, viewDirection, headDirection, _MatCap2ndVRParallaxStrength, _MatCap2ndZRotCancel);
float4 matCap2ndColor = _MatCap2ndColor;
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/Includes/lil_tessellation.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lilTessellationFactors hullConst(InputPatch<appdata, 3> input)
abs(dot(vertexNormalInput_1.normalWS, lilViewDirection(vertexInput_1.positionWS))),
abs(dot(vertexNormalInput_2.normalWS, lilViewDirection(vertexInput_2.positionWS))));
#endif
nv = 1.0 - float3(nv.y + nv.z, nv.z + nv.x, nv.x + nv.y) * 0.5;
nv = saturate(1.0 - float3(nv.y + nv.z, nv.z + nv.x, nv.x + nv.y) * 0.5);
tessFactor.xyz = max(tessFactor.xyz * nv * nv, 1.0);
tessFactor.w = (tessFactor.x+tessFactor.y+tessFactor.z) / 3.0;

Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jp.lilxyzw.liltoon",
"displayName": "lilToon",
"version": "1.2.0",
"version": "1.2.2",
"unity": "2017.1",
"description": "Feature-rich toon shader.",
"keywords": ["Toon", "Shader", "Material"],
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"latest_vertion_name": "1.2.1", "latest_vertion_value": 14}
{"latest_vertion_name": "1.2.2", "latest_vertion_value": 15}

0 comments on commit 76d95cc

Please sign in to comment.