Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lilxyzw committed Aug 17, 2021
1 parent 6cecb05 commit 3143399
Show file tree
Hide file tree
Showing 19 changed files with 127 additions and 81 deletions.
3 changes: 3 additions & 0 deletions Assets/lilToon/Editor/lang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sEditorModePreset Preset プリセット 프리셋 预设 預設
sHelpSimple In this mode, you can easily edit the appearance. 簡単に見た目を編集するモードです。 간단하게 외형을 편집하는 모드입니다. 这种模式进行简单的设置。 這種模式進行簡單的設置。
sHelpAdvanced In this mode, you can make detailed settings for the material. 詳細設定を行うモードです。 상세 설정을 실시하는 모드입니다. 此模式用于进行详细设置。 此模式用於進行詳細設置。
sHelpPreset In this mode, you can easily set up materials from presets. プリセットから一括で設定するモードです。 프리셋에서 일괄로 설정하는 모드입니다. 在这个模式下,你可以很容易地从预设中设置材料。 在這個模式下,你可以很容易地從預設中設置材料。
sHelpSelectOverlay Currently lilToonOverray is selected. Change to lilToon for normal use. 現在lilToonOverrayが選択されています。通常の用途で使う場合はlilToonに変更してください。 현재 lilToonOverray가 선택되어있습니다.일반 용도에서는 lilToon으로 변경해주세요. 目前正在选择lilToonOverray。如果是通常的用途的话请变更为lilToon。 目前正在選擇lilToonOverray。如果是通常的用途的話請變更為lilToon。
sColor Color 色 색 颜色 顏色
sGamma Gamma ガンマ 감마 伽玛 伽瑪
sHue Hue 色相 색상 色相 色相
Expand Down Expand Up @@ -116,6 +117,7 @@ sMainColor Main Color メインカラー 메인 컬러 主色 主色
sMainColor2nd Main Color 2nd メインカラー2nd 메인 컬러 2nd 主色2nd 主色2nd
sMainColor3rd Main Color 3rd メインカラー3rd 메인 컬러 3rd 主色3rd 主色3rd
sGradationMap Gradation Map グラデーションマップ 그라디언트 맵 渐变映射 漸變映射
sNotAlphaIsTransparency This texture is not marked as AlphaIsTransparency このテクスチャはAlphaIsTransparencyとして設定されていません 이 텍스처는 Alpha Is Transparency로 설정되어 있지 않습니다 此纹理未被设置为AlphaIsTransparency 此紋理未被設置為AlphaIsTransparency
sAlphaMask Alpha Mask アルファマスク 알파 마스크 Alpha蒙版 Alpha蒙版
sAlphaMaskWarnOpaque If you want to use Alpha Mask, you need to change the "Rendering Mode" to Cutout or Transparent. アルファマスクを使う場合は"透過モード"をカットアウトか半透明に変更する必要があります。 알파 마스크를 사용하려면 "Rendering Mode"를 단편 또는 반투명로 변경해야합니다. 如果要使用Alpha蒙版,则需要将“Rendering Mode”更改为镂空或透明。 如果要使用Alpha蒙版,則需要將“Rendering Mode”更改為鏤空或透明。
sAlphaMaskModeNone None None None None None
Expand Down Expand Up @@ -280,6 +282,7 @@ sNo No いいえ No No No
sOK OK OK OK OK OK
sCancel Cancel キャンセル Cancel Cancel Cancel
sComplete Complete! 完了しました。 Complete! Complete! Complete!
sFixNow Fix Now 自動修正 자동 수정 自动修改 自動修改
sDialogResetUV Reset UV Setting UV設定の初期化 UV 설정 초기화 重置UV设置 重置UV設置
sDialogResetUVMes Are you sure you want to reset UV setting? UV設定を初期化しますか? UV 설정을 초기화 하시겠습니까? 你确定要重置UV设置吗? 你確定要重置UV設置嗎?
sDialogCannotBake Cannot run a bake 焼き込みを実行できません 버닝을 실행할 수 없습니다 不能运行烘烤 不能運行烘烤
Expand Down
121 changes: 84 additions & 37 deletions Assets/lilToon/Editor/lilInspector.cs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Assets/lilToon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.1.5
Version 1.1.6

# Overview
This shader is developed for services using avatars (VRChat, etc.) and has the following features.
Expand Down Expand Up @@ -130,6 +130,10 @@ Comparing parameters when implementing `Convert to MToon (VRM)`
- [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042)

# Change log
## v1.1.6
- Changed the default value of ZTest in outline from LessEqual to Less
- Fixed an issue where shadows were weakened when using `Lower brightness limit`
- Added `Fix Now` button to help box
## v1.1.5
- Added `When in trouble...`
- Improved transparency processing
Expand Down
6 changes: 5 additions & 1 deletion Assets/lilToon/README_JP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# lilToon
Version 1.1.5
Version 1.1.6

# 概要
アバターを用いたサービス(VRChat等)向けに開発したシェーダーで以下のような特徴があります。
Expand Down Expand Up @@ -130,6 +130,10 @@ VRChatのワールド:
- [視差オクルージョンマッピング(parallax occlution mapping) (コポコポ)](https://coposuke.hateblo.jp/entry/2019/01/20/043042)

# 変更履歴
## v1.1.6
- ヘルプボックスに自動修正ボタンを追加
- 明るさの下限設定で影が弱くなる問題の修正
- 輪郭線のZTestのデフォルト値をLessEqualからLessに変更
## v1.1.5
- `困ったときは…`を追加
- 透過処理を改善
Expand Down
7 changes: 3 additions & 4 deletions Assets/lilToon/Shader/Includes/lil_fur_fragment.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ float4 frag(g2f input) : SV_Target
LIL_GET_VERTEXLIGHT(input, vertexLightColor);
LIL_GET_ADDITIONALLIGHT(input.positionWS, additionalLightColor);
#if !defined(LIL_PASS_FORWARDADD)
lightColor = max(lightColor, _LightMinLimit);
lightColor = lerp(lightColor, 1.0, _AsUnlit);
vertexLightColor = lerp(vertexLightColor, 0.0, _AsUnlit);
additionalLightColor = lerp(additionalLightColor, 0.0, _AsUnlit);
float3 addLightColor = lerp(vertexLightColor + additionalLightColor, 0.0, _AsUnlit);
#else
lightColor = lerp(lightColor, 0.0, _AsUnlit);
#endif
Expand Down Expand Up @@ -72,9 +72,8 @@ float4 frag(g2f input) : SV_Target
#else
col.rgb *= lightColor;
#endif
col.rgb += albedo * (vertexLightColor + additionalLightColor);
col.rgb += albedo * addLightColor;
col.rgb = min(col.rgb, albedo);
col.rgb = max(col.rgb, albedo * _LightMinLimit);
#else
col.rgb *= lightColor;
#endif
Expand Down
18 changes: 6 additions & 12 deletions Assets/lilToon/Shader/Includes/lil_lite_fragment.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target
LIL_GET_VERTEXLIGHT(input, vertexLightColor);
LIL_GET_ADDITIONALLIGHT(input.positionWS, additionalLightColor);
#if !defined(LIL_PASS_FORWARDADD)
lightColor = max(lightColor, _LightMinLimit);
lightColor = lerp(lightColor, 1.0, _AsUnlit);
vertexLightColor = lerp(vertexLightColor, 0.0, _AsUnlit);
additionalLightColor = lerp(additionalLightColor, 0.0, _AsUnlit);
float3 addLightColor = lerp(vertexLightColor + additionalLightColor, 0.0, _AsUnlit);
#else
lightColor = lerp(lightColor, 0.0, _AsUnlit);
#endif
Expand Down Expand Up @@ -48,8 +48,7 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target

//----------------------------------------------------------------------------------------------------------------------
// Lighting
col.rgb = lerp(col.rgb, col.rgb * saturate(lightColor + vertexLightColor + additionalLightColor), _OutlineEnableLighting);
col.rgb = max(col.rgb, albedo * _LightMinLimit);
col.rgb = lerp(col.rgb, col.rgb * saturate(lightColor + addLightColor), _OutlineEnableLighting);
#else
//----------------------------------------------------------------------------------------------------------------------
// UV
Expand Down Expand Up @@ -98,18 +97,13 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target
float shadowmix = 1.0;
lilGetShadingLite(col, shadowmix, albedo, lightColor, uvMain, facing, normalDirection, lightDirection, sampler_MainTex);

lightColor += vertexLightColor;
shadowmix += lilLuminance(vertexLightColor);
col.rgb += albedo * vertexLightColor;

lightColor += additionalLightColor;
shadowmix += lilLuminance(additionalLightColor);
col.rgb += albedo * additionalLightColor;
lightColor += addLightColor;
shadowmix += lilLuminance(addLightColor);
col.rgb += albedo * addLightColor;

lightColor = saturate(lightColor);
shadowmix = saturate(shadowmix);
col.rgb = min(col.rgb, albedo);
col.rgb = max(col.rgb, albedo * _LightMinLimit);
#else
col.rgb *= lightColor;
#endif
Expand Down
23 changes: 9 additions & 14 deletions Assets/lilToon/Shader/Includes/lil_normal_fragment.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target
LIL_GET_VERTEXLIGHT(input, vertexLightColor);
LIL_GET_ADDITIONALLIGHT(input.positionWS, additionalLightColor);
#if !defined(LIL_PASS_FORWARDADD)
lightColor = max(lightColor, _LightMinLimit);
lightColor = lerp(lightColor, 1.0, _AsUnlit);
vertexLightColor = lerp(vertexLightColor, 0.0, _AsUnlit);
additionalLightColor = lerp(additionalLightColor, 0.0, _AsUnlit);
float3 addLightColor = lerp(vertexLightColor + additionalLightColor, 0.0, _AsUnlit);
#else
lightColor = lerp(lightColor, 0.0, _AsUnlit);
#endif
Expand Down Expand Up @@ -105,8 +105,7 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target

//----------------------------------------------------------------------------------------------------------------------
// Lighting
col.rgb = lerp(col.rgb, col.rgb * saturate(lightColor + vertexLightColor + additionalLightColor), _OutlineEnableLighting);
col.rgb = max(col.rgb, albedo * _LightMinLimit);
col.rgb = lerp(col.rgb, col.rgb * saturate(lightColor + addLightColor), _OutlineEnableLighting);
#elif defined(LIL_FUR)
//--------------------------------------------------------------------------------------------------------------------------
// UV
Expand Down Expand Up @@ -152,10 +151,11 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target
normalDirection = facing < (_FlipNormal-1.0) ? -normalDirection : normalDirection;
float shadowmix = 1.0;
lilGetShading(col, shadowmix, albedo, lightColor, uvMain, facing, normalDirection, 1, lightDirection, sampler_MainTex);
#else
col.rgb *= lightColor;
#endif
col.rgb += albedo * vertexLightColor + albedo * additionalLightColor;
col.rgb += albedo * addLightColor;
col.rgb = min(col.rgb, albedo);
col.rgb = max(col.rgb, albedo * _LightMinLimit);
#else
col.rgb *= lightColor;
// Premultiply for ForwardAdd
Expand Down Expand Up @@ -535,18 +535,13 @@ float4 frag(v2f input, float facing : VFACE) : SV_Target
col.rgb *= lightColor;
#endif

lightColor += vertexLightColor;
shadowmix += lilLuminance(vertexLightColor);
col.rgb += albedo * vertexLightColor;

lightColor += additionalLightColor;
shadowmix += lilLuminance(additionalLightColor);
col.rgb += albedo * additionalLightColor;
lightColor += addLightColor;
shadowmix += lilLuminance(addLightColor);
col.rgb += albedo * addLightColor;

lightColor = saturate(lightColor);
shadowmix = saturate(shadowmix);
col.rgb = min(col.rgb, albedo);
col.rgb = max(col.rgb, albedo * _LightMinLimit);

#if defined(LIL_FEATURE_MAIN2ND)
if(_UseMain2ndTex) col.rgb = lilBlendColor(col.rgb, color2nd.rgb, color2nd.a - color2nd.a * _Main2ndEnableLighting, _Main2ndTexBlendMode);
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/Includes/lil_pass_shadowcaster.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct v2f
{
LIL_V2F_SHADOW_CASTER
#if LIL_RENDER > 0
float2 uv : TEXCOORD0;
float2 uv : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_cutout_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Shader "Hidden/lilToonCutoutOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Shader "Hidden/lilToonOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_tess_cutout_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Shader "Hidden/lilToonTessellationCutoutOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_tess_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Shader "Hidden/lilToonTessellationOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_tess_trans_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Shader "Hidden/lilToonTessellationTransparentOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/lts_trans_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Shader "Hidden/lilToonTransparentOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/ltsl_cutout_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Shader "Hidden/lilToonLiteCutoutOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
2 changes: 1 addition & 1 deletion Assets/lilToon/Shader/ltsl_o.shader
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Shader "Hidden/lilToonLiteOutline"
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpFA ("ForwardAdd BlendOp", Int) = 4
[Enum(UnityEngine.Rendering.BlendOp)] _OutlineBlendOpAlphaFA ("ForwardAdd BlendOpAlpha", Int) = 4
[lilToggle] _OutlineZWrite ("ZWrite", Int) = 1
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 4
[Enum(UnityEngine.Rendering.CompareFunction)] _OutlineZTest ("ZTest", Int) = 2
[IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0
[IntRange] _OutlineStencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255
[IntRange] _OutlineStencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255
Expand Down
Loading

0 comments on commit 3143399

Please sign in to comment.