Skip to content

Commit aad6352

Browse files
Updated UTS2 v.2.0.7.5 / Release
2 parents fdb7824 + 85eddb8 commit aad6352

10 files changed

+66
-43
lines changed

Assets/Toon/Editor/UTS2GUI.cs

+26-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public enum _EmissiveMode{
3939
static float _UTS2VersionNumber = 2.075f;
4040
//
4141
static int _StencilNo_Setting;
42-
//static bool _HasOutline = true;
4342
static bool _OriginalInspector = false;
4443
static bool _SimpleUI = false;
4544
//メッセージ表示用.
@@ -504,7 +503,6 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro
504503
EditorGUILayout.Space();
505504

506505
if(material.HasProperty("_OUTLINE")){
507-
//_HasOutline = true;
508506
_Outline_Foldout = Foldout(_Outline_Foldout, "【Outline Settings】");
509507
if (_Outline_Foldout)
510508
{
@@ -514,8 +512,6 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro
514512
EditorGUI.indentLevel--;
515513
}
516514
EditorGUILayout.Space();
517-
//}else{
518-
//_HasOutline = false;
519515
}
520516

521517
if(material.HasProperty("_TessEdgeLength")){
@@ -818,13 +814,14 @@ void Set_Vrchat_Recommendation(Material material)
818814
if(material.HasProperty("_AngelRing")){//AngelRingがある場合.
819815
material.SetFloat("_Is_LightColor_AR",1);
820816
}
817+
if(material.HasProperty("_OUTLINE"))//OUTLINEがある場合.
818+
{
819+
material.SetFloat("_Is_LightColor_Outline",1);
820+
}
821821
material.SetFloat("_Set_SystemShadowsToBase",1);
822822
material.SetFloat("_Is_Filter_HiCutPointLightColor",1);
823823
material.SetFloat("_CameraRolling_Stabilizer",1);
824824
material.SetFloat("_Is_Ortho",0);
825-
// if(_HasOutline){
826-
// material.SetFloat("_Is_BlendBaseColor",1);
827-
// }
828825
material.SetFloat("_GI_Intensity",0);
829826
material.SetFloat("_Unlit_Intensity",1);
830827
material.SetFloat("_Is_Filter_LightColor",1);
@@ -1853,6 +1850,24 @@ void GUI_LightColorContribution(Material material)
18531850
EditorGUILayout.EndHorizontal();
18541851
}
18551852

1853+
if(material.HasProperty("_OUTLINE"))//OUTLINEがある場合.
1854+
{
1855+
EditorGUILayout.BeginHorizontal();
1856+
EditorGUILayout.PrefixLabel("Outline");
1857+
//GUILayout.Space(60);
1858+
if(material.GetFloat("_Is_LightColor_Outline") == 0){
1859+
if (GUILayout.Button("Off",shortButtonStyle))
1860+
{
1861+
material.SetFloat("_Is_LightColor_Outline",1);
1862+
}
1863+
}else{
1864+
if (GUILayout.Button("Active",shortButtonStyle))
1865+
{
1866+
material.SetFloat("_Is_LightColor_Outline",0);
1867+
}
1868+
}
1869+
EditorGUILayout.EndHorizontal();
1870+
}
18561871
EditorGUILayout.Space();
18571872
}
18581873

@@ -1871,6 +1886,10 @@ void GUI_AdditionalLightingSettings(Material material)
18711886
material.SetFloat("_Is_LightColor_Base",1);
18721887
material.SetFloat("_Is_LightColor_1st_Shade",1);
18731888
material.SetFloat("_Is_LightColor_2nd_Shade",1);
1889+
if(material.HasProperty("_OUTLINE"))//OUTLINEがある場合.
1890+
{
1891+
material.SetFloat("_Is_LightColor_Outline",1);
1892+
}
18741893
}
18751894
}else{
18761895
if (GUILayout.Button("Active",shortButtonStyle))

Assets/Toon/Shader/README.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ They will be useful for reference of the look and scene you want to make!
147147

148148
-----
149149
## 【Version】
150-
### 2019/05/20:2.0.7 Release:修正リリース版5
150+
### 2019/05/22:2.0.7 Release:修正リリース版5
151151
* 修正リリース版4を破棄し、新規に「アウトラインにZ-Offsetを指定した場合、鏡オブジェクトに映った像のアウトラインの表示不正」を修正しました。
152-
* 従来はBase Colorと一緒になっていた、_Is_LightColor_Outlineを追加しました。カスタムGUIからは「LightColor Contribution to Materials」メニューからアクセスできます
152+
* アウトラインカラーへライトカラーを反応させる、"_Is_LightColor_Outline"を追加しました。カスタムGUIからは「LightColor Contribution to Materials」メニューから"Outline"ボタンを"Active"にすることで機能をONにすることができます。アウトラインの場合、ライトカラーへの反応はいくつか仕様上の制約がありますので、詳しくはマニュアルを参照してください
153153

154154
### 2019/05/15:2.0.7 Release:修正リリース版4
155155
* アウトラインにZ-Offsetを指定した場合、鏡オブジェクトに映った像のアウトラインの表示不正の発生を緩和しました。
@@ -183,9 +183,9 @@ They will be useful for reference of the look and scene you want to make!
183183
* 全てのバージョンのUnityで、鏡に映るMatCapの像とCamera Rolling Stabilizerが正しく機能するようになりました。
184184

185185
---
186-
### 2019/05/20: 2.0.7 Release: Fixed release version 5
186+
### 2019/05/22: 2.0.7 Release: Fixed release version 5
187187
* Fixed Version 4 has been discarded and a new "the problem of incorrect display of the image outline reflected in the mirror object when Z-Offset is specified in the outline" has been corrected.
188-
* Added _Is_LightColor_Outline, which was formerly with Base Color. You can access it from the "LightColor Contribution to Materials" menu from the custom GUI Inspctor.
188+
* Added "_Is_LightColor_Outline" to make light color react to outline color. From the custom GUI, the function can be turned on by setting "Outline" button to "Active" from "LightColor Contribution to Materials" menu. In the case of the outline, there are some specification restrictions on the reaction to the light color, so please refer to the manual for details.
189189

190190
### 2019/05/15: 2.0.7 Release: Fixed release version 4
191191
* When Z-Offset is specified for the outline, the problem of incorrect display of the outline of the image reflected in the mirror object has been alleviated.
@@ -329,11 +329,11 @@ This function was developed based on the Issue #18 of ACiiL TwitterID: @__aciil'
329329

330330
-----
331331
最新バージョン:2.0.7 Release:修正リリース版5
332-
最終リリース日:2019/05/20
332+
最終リリース日:2019/05/22
333333
カテゴリー:3D
334334
形式:zip/unitypackage
335335

336336
Latest Version: 2.0.7 Release: Fixed release version 5
337-
Update: 2019/05/20
337+
Update: 2019/05/22
338338
Category: 3D
339339
File format: zip/unitypackage

Assets/Toon/Shader/Tess/UCTS_Outline_Tess.cginc

+12-12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
//v.2.0.7.5
2222
uniform float _Unlit_Intensity;
2323
uniform fixed _Is_Filter_LightColor;
24+
uniform fixed _Is_LightColor_Outline;
2425
//v.2.0.5
2526
uniform float4 _Color;
2627
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
@@ -114,31 +115,30 @@
114115
//v.2.0.5
115116
_Color = _BaseColor;
116117
float4 objPos = mul ( unity_ObjectToWorld, float4(0,0,0,1) );
117-
//v.2.0.7.5
118-
float3 defaultLightColor = saturate(max(half3(0.05,0.05,0.05),max(ShadeSH9(half4(0.0, 0.0, 0.0, 1.0)),ShadeSH9(half4(0.0, -1.0, 0.0, 1.0)).rgb)*_Unlit_Intensity));
119-
float defaultLightColorIntensity = (0.299*defaultLightColor.r + 0.587*defaultLightColor.g + 0.114*defaultLightColor.b);
120-
defaultLightColorIntensity = lerp(defaultLightColorIntensity, saturate(defaultLightColorIntensity), _Is_Filter_LightColor);
121-
float3 lightColor = saturate(lerp(max(defaultLightColor,_LightColor0.rgb),max(defaultLightColor,saturate(_LightColor0.rgb)),_Is_Filter_LightColor));
122-
float3 Unlit_LightColor_Level = saturate(float3(defaultLightColorIntensity,defaultLightColorIntensity,defaultLightColorIntensity)*_Unlit_Intensity*3);
123-
lightColor = max(lightColor,Unlit_LightColor_Level);
118+
//v.2.0.7.5
119+
half3 ambientSkyColor = unity_AmbientSky.rgb>0.05 ? unity_AmbientSky.rgb*_Unlit_Intensity : half3(0.05,0.05,0.05)*_Unlit_Intensity;
120+
float3 lightColor = _LightColor0.rgb >0.05 ? _LightColor0.rgb : ambientSkyColor.rgb;
121+
float lightColorIntensity = (0.299*lightColor.r + 0.587*lightColor.g + 0.114*lightColor.b);
122+
lightColor = lightColorIntensity<1 ? lightColor : lightColor/lightColorIntensity;
123+
lightColor = lerp(half3(1.0,1.0,1.0), lightColor, _Is_LightColor_Outline);
124124
float2 Set_UV0 = i.uv0;
125125
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(Set_UV0, _MainTex));
126126
float3 Set_BaseColor = _BaseColor.rgb*_MainTex_var.rgb;
127-
float3 _Is_BlendBaseColor_var = lerp( _Outline_Color.rgb*lightColor, (_Outline_Color.rgb*Set_BaseColor*lightColor), _Is_BlendBaseColor );
127+
float3 _Is_BlendBaseColor_var = lerp( _Outline_Color.rgb*lightColor, (_Outline_Color.rgb*Set_BaseColor*Set_BaseColor*lightColor), _Is_BlendBaseColor );
128128
//
129129
float3 _OutlineTex_var = tex2D(_OutlineTex,TRANSFORM_TEX(Set_UV0, _OutlineTex));
130-
//v.2.0.4
130+
//v.2.0.7.5
131131
#ifdef _IS_OUTLINE_CLIPPING_NO
132-
float3 Set_Outline_Color = lerp(_Is_BlendBaseColor_var, _OutlineTex_var.rgb*_Is_BlendBaseColor_var, _Is_OutlineTex );
133-
return fixed4(Set_Outline_Color,1.0);
132+
float3 Set_Outline_Color = lerp(_Is_BlendBaseColor_var, _OutlineTex_var.rgb*_Outline_Color.rgb*lightColor, _Is_OutlineTex );
133+
return float4(Set_Outline_Color,1.0);
134134
#elif _IS_OUTLINE_CLIPPING_YES
135135
float4 _ClippingMask_var = tex2D(_ClippingMask,TRANSFORM_TEX(Set_UV0, _ClippingMask));
136136
float Set_MainTexAlpha = _MainTex_var.a;
137137
float _IsBaseMapAlphaAsClippingMask_var = lerp( _ClippingMask_var.r, Set_MainTexAlpha, _IsBaseMapAlphaAsClippingMask );
138138
float _Inverse_Clipping_var = lerp( _IsBaseMapAlphaAsClippingMask_var, (1.0 - _IsBaseMapAlphaAsClippingMask_var), _Inverse_Clipping );
139139
float Set_Clipping = saturate((_Inverse_Clipping_var+_Clipping_Level));
140140
clip(Set_Clipping - 0.5);
141-
float4 Set_Outline_Color = lerp( float4(_Is_BlendBaseColor_var,Set_Clipping), float4((_OutlineTex_var.rgb*_Is_BlendBaseColor_var),Set_Clipping), _Is_OutlineTex );
141+
float4 Set_Outline_Color = lerp( float4(_Is_BlendBaseColor_var,Set_Clipping), float4((_OutlineTex_var.rgb*_Outline_Color.rgb*lightColor),Set_Clipping), _Is_OutlineTex );
142142
return Set_Outline_Color;
143143
#endif
144144
}

Assets/Toon/Shader/UCTS_Outline.cginc

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
//v.2.0.7.5
1818
uniform float _Unlit_Intensity;
1919
uniform fixed _Is_Filter_LightColor;
20+
uniform fixed _Is_LightColor_Outline;
2021
//v.2.0.5
2122
uniform float4 _Color;
2223
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
@@ -97,31 +98,30 @@
9798
//v.2.0.5
9899
_Color = _BaseColor;
99100
float4 objPos = mul ( unity_ObjectToWorld, float4(0,0,0,1) );
100-
//v.2.0.7.5
101-
float3 defaultLightColor = saturate(max(half3(0.05,0.05,0.05),max(ShadeSH9(half4(0.0, 0.0, 0.0, 1.0)),ShadeSH9(half4(0.0, -1.0, 0.0, 1.0)).rgb)*_Unlit_Intensity));
102-
float defaultLightColorIntensity = (0.299*defaultLightColor.r + 0.587*defaultLightColor.g + 0.114*defaultLightColor.b);
103-
defaultLightColorIntensity = lerp(defaultLightColorIntensity, saturate(defaultLightColorIntensity), _Is_Filter_LightColor);
104-
float3 lightColor = saturate(lerp(max(defaultLightColor,_LightColor0.rgb),max(defaultLightColor,saturate(_LightColor0.rgb)),_Is_Filter_LightColor));
105-
float3 Unlit_LightColor_Level = saturate(float3(defaultLightColorIntensity,defaultLightColorIntensity,defaultLightColorIntensity)*_Unlit_Intensity*3);
106-
lightColor = max(lightColor,Unlit_LightColor_Level);
101+
//v.2.0.7.5
102+
half3 ambientSkyColor = unity_AmbientSky.rgb>0.05 ? unity_AmbientSky.rgb*_Unlit_Intensity : half3(0.05,0.05,0.05)*_Unlit_Intensity;
103+
float3 lightColor = _LightColor0.rgb >0.05 ? _LightColor0.rgb : ambientSkyColor.rgb;
104+
float lightColorIntensity = (0.299*lightColor.r + 0.587*lightColor.g + 0.114*lightColor.b);
105+
lightColor = lightColorIntensity<1 ? lightColor : lightColor/lightColorIntensity;
106+
lightColor = lerp(half3(1.0,1.0,1.0), lightColor, _Is_LightColor_Outline);
107107
float2 Set_UV0 = i.uv0;
108108
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(Set_UV0, _MainTex));
109109
float3 Set_BaseColor = _BaseColor.rgb*_MainTex_var.rgb;
110-
float3 _Is_BlendBaseColor_var = lerp( _Outline_Color.rgb*lightColor, (_Outline_Color.rgb*Set_BaseColor*lightColor), _Is_BlendBaseColor );
110+
float3 _Is_BlendBaseColor_var = lerp( _Outline_Color.rgb*lightColor, (_Outline_Color.rgb*Set_BaseColor*Set_BaseColor*lightColor), _Is_BlendBaseColor );
111111
//
112112
float3 _OutlineTex_var = tex2D(_OutlineTex,TRANSFORM_TEX(Set_UV0, _OutlineTex));
113-
//v.2.0.4
113+
//v.2.0.7.5
114114
#ifdef _IS_OUTLINE_CLIPPING_NO
115-
float3 Set_Outline_Color = lerp(_Is_BlendBaseColor_var, _OutlineTex_var.rgb*_Is_BlendBaseColor_var, _Is_OutlineTex );
116-
return fixed4(Set_Outline_Color,1.0);
115+
float3 Set_Outline_Color = lerp(_Is_BlendBaseColor_var, _OutlineTex_var.rgb*_Outline_Color.rgb*lightColor, _Is_OutlineTex );
116+
return float4(Set_Outline_Color,1.0);
117117
#elif _IS_OUTLINE_CLIPPING_YES
118118
float4 _ClippingMask_var = tex2D(_ClippingMask,TRANSFORM_TEX(Set_UV0, _ClippingMask));
119119
float Set_MainTexAlpha = _MainTex_var.a;
120120
float _IsBaseMapAlphaAsClippingMask_var = lerp( _ClippingMask_var.r, Set_MainTexAlpha, _IsBaseMapAlphaAsClippingMask );
121121
float _Inverse_Clipping_var = lerp( _IsBaseMapAlphaAsClippingMask_var, (1.0 - _IsBaseMapAlphaAsClippingMask_var), _Inverse_Clipping );
122122
float Set_Clipping = saturate((_Inverse_Clipping_var+_Clipping_Level));
123123
clip(Set_Clipping - 0.5);
124-
float4 Set_Outline_Color = lerp( float4(_Is_BlendBaseColor_var,Set_Clipping), float4((_OutlineTex_var.rgb*_Is_BlendBaseColor_var),Set_Clipping), _Is_OutlineTex );
124+
float4 Set_Outline_Color = lerp( float4(_Is_BlendBaseColor_var,Set_Clipping), float4((_OutlineTex_var.rgb*_Outline_Color.rgb*lightColor),Set_Clipping), _Is_OutlineTex );
125125
return Set_Outline_Color;
126126
#endif
127127
}

Manual/UTS2_Manual_en.md

+1
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ While actually using the character lights used in the scene, you can see in real
979979
| `Ap_RimLight` | Applies the light color to the Ap_RimLight Color. | _Is_LightColor_Ap_RimLight |
980980
| `MatCap` | Applies the light color to the MatCap Color. | _Is_LightColor_MatCap |
981981
| `AngelRing` | Applies the light color to the AngelRing Color. | _Is_LightColor_AR |
982+
| `Outline` | Applies the light color to the Outline Color. The contribution of the light color to the outline is: When "OFF", the color set for the outline color is displayed as it is. When "Active with 1 realtime directional light in the scene", the outline color responds to the color and brightness of the realtime directional light. When "There is no real-time directional light in the scene at the time of Active", the outline color responds to the color and brightness of Color in the Source of Environment Lighting. **At this time, please note that the value of Color is referenced even if you are using Skybox. In addition, please be careful as it does not react to ambient light other than real-time point light and color.** | _Is_LightColor_Outline |
982983

983984
**※ Hint: Turning off any color switch will cause that color’s Light Intensity to be set to 1 with a light color of white, regardless of the strength of other lights in the environment.**
984985

Manual/UTS2_Manual_ja.md

+1
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ Light版とあるものは、ライトをディレクショナルライト1灯
974974
| `Ap_RimLight` | APリムライト(対蹠リムライト)に対しライトカラーを有効にします。 | _Is_LightColor_Ap_RimLight |
975975
| `MatCap` | MatCapに対しライトカラーを有効にします。 | _Is_LightColor_MatCap |
976976
| `AngelRing` | 「天使の輪」に対しライトカラーを有効にします。 | _Is_LightColor_AR |
977+
| `Outline` | アウトラインに対しライトカラーを有効にします。アウトラインに対するライトカラーの寄与は次のとおりです。「OFF」の時、アウトラインカラーに設定したカラーがそのまま表示されます。「Activeの時でシーン中にリアルタイムディレクショナルライトが1灯ある」時、リアルタイムディレクショナルライトのカラーと明るさにアウトラインカラーが反応します。「Activeの時でシーン中にリアルタイムディレクショナルライトがない」時、Environment LightingのSourceの内、Colorの色と明るさにアウトラインカラーが反応します。**この時、Skyboxを使用していてもColorの値が参照されることに注意してください。またリアルタイムのポイントライトやColor以外の環境光には、反応しませんので合わせてご注意ください。** | _Is_LightColor_Outline |
977978

978979
※ヒント:各カラーの設定が `Off` の場合、シーン内のライトの強さに関わらず、「オフにされたカラーは、常にライトのIntensityが1、ライトカラーが白の状態で照らされている状態」になります。
979980

Manual/UTS2_Props_en.md

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ These properties are common among UTS2’s high spec ShadingGradeMap shaders.
239239
| `Outline_Sampler` | When you want to see the “start” and “end” of your outlines, or when you only want to outline certain parts, use the outline sampler (texture). The thickest width with white and the least thickest with white. |
240240
| `Outline_Color` | Specifies the color of the outline. |
241241
| `Is_BlendBaseColor` | Select this when you want to blend the color of the outline with the object’s base color. |
242+
| `Is_LightColor_Outline` | Applies the light color to the Outline Color. The contribution of the light color to the outline is: When "OFF", the color set for the outline color is displayed as it is. When "Active with 1 realtime directional light in the scene", the outline color responds to the color and brightness of the realtime directional light. When "There is no real-time directional light in the scene at the time of Active", the outline color responds to the color and brightness of Color in the Source of Environment Lighting. **At this time, please note that the value of Color is referenced even if you are using Skybox. In addition, please be careful as it does not react to ambient light other than real-time point light and color.** |
242243
| `Is_OutlineTex` | Turn it on when you want to paste texture to the inverted-outline object. |
243244
| `OutlineTex` | Use this when you want the outline to have special textures. By changing the textures, you can give the outlines patterns, or make the outline unique by changing the texture of the inverted object which will be front-face culled. |
244245
| `Offset_Camera_Z` | Offsets the outlines in direction Z. The outline will be less visible for the spikey parts in spikey hair if you input a positive value. For most cases, just set this to 0. |

0 commit comments

Comments
 (0)