Fix : 닐로툰 퍼 컨트롤러 호환성 추가 패치

This commit is contained in:
KINDNICK 2025-12-17 00:03:52 +09:00
parent ec5e2fb8f5
commit 98eeeba24b
3 changed files with 28 additions and 11 deletions

View File

@ -158,8 +158,8 @@ Shader "Universal Render Pipeline/NiloToon/NiloToon_Character_Fur"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[HideInInspector] _PerCharacterBaseColorMultiply("_PerCharacterBaseColorMultiply", Float) = 1
[HideInInspector] _PerCharacterBaseColorTint("_PerCharacterBaseColorTint", Color) = (1, 1, 1, 1)
[HideInInspector] _PerCharacterTintColor("_PerCharacterTintColor", Color) = (1, 1, 1, 1)
[HideInInspector] _PerCharacterAddColor("_PerCharacterAddColor", Color) = (0, 0, 0, 0)
[HideInInspector] _PerCharEffectTintColor("_PerCharEffectTintColor", Color) = (1, 1, 1, 1)
[HideInInspector] _PerCharEffectAddColor("_PerCharEffectAddColor", Color) = (0, 0, 0, 0)
[HideInInspector] _PerCharEffectDesaturatePercentage("_PerCharEffectDesaturatePercentage", Range(0,1)) = 0
[HideInInspector] _PerCharEffectLerpColor("_PerCharEffectLerpColor", Color) = (1, 1, 0, 0)
@ -551,6 +551,11 @@ Shader "Universal Render Pipeline/NiloToon/NiloToon_Character_Fur"
half alpha = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv).a * _BaseColor.a;
clip(alpha - _Cutoff);
// Apply dither fadeout to shadow casting (must come before dissolve)
#if _NILOTOON_DITHER_FADEOUT
NiloDoDitherFadeoutClip(input.positionCS.xy, 1.0 - _DitherFadeoutAmount * _AllowPerCharacterDitherFadeout);
#endif
// Apply dissolve to shadow casting
#if _NILOTOON_DISSOLVE
half3 dummyColor = half3(1, 1, 1);
@ -624,6 +629,11 @@ Shader "Universal Render Pipeline/NiloToon/NiloToon_Character_Fur"
half alpha = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv).a * _BaseColor.a;
clip(alpha - _Cutoff);
// Apply dither fadeout to depth (must come before dissolve)
#if _NILOTOON_DITHER_FADEOUT
NiloDoDitherFadeoutClip(input.positionCS.xy, 1.0 - _DitherFadeoutAmount * _AllowPerCharacterDitherFadeout);
#endif
// Apply dissolve to depth
#if _NILOTOON_DISSOLVE
half3 dummyColor = half3(1, 1, 1);
@ -697,6 +707,12 @@ Shader "Universal Render Pipeline/NiloToon/NiloToon_Character_Fur"
half alpha = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv).a * _BaseColor.a;
clip(alpha - _Cutoff);
// Apply dither fadeout to depth normals (must come before dissolve)
// This is critical for HBAO/SSAO - without this, AO will render on dithered areas
#if _NILOTOON_DITHER_FADEOUT
NiloDoDitherFadeoutClip(input.positionCS.xy, 1.0 - _DitherFadeoutAmount * _AllowPerCharacterDitherFadeout);
#endif
// Apply dissolve to depth normals
#if _NILOTOON_DISSOLVE
half3 dummyColor = half3(1, 1, 1);
@ -777,6 +793,11 @@ Shader "Universal Render Pipeline/NiloToon/NiloToon_Character_Fur"
half alpha = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv).a * _BaseColor.a;
clip(alpha - _Cutoff);
// Apply dither fadeout to prepass buffer (must come before dissolve)
#if _NILOTOON_DITHER_FADEOUT
NiloDoDitherFadeoutClip(input.positionCS.xy, 1.0 - _DitherFadeoutAmount * _AllowPerCharacterDitherFadeout);
#endif
// Apply dissolve to prepass buffer
#if _NILOTOON_DISSOLVE
half3 dummyColor = half3(1, 1, 1);

View File

@ -143,17 +143,13 @@ half3 ApplyPerCharacterColorControls(half3 color)
color *= _PerCharacterBaseColorMultiply;
color *= _PerCharacterBaseColorTint.rgb;
// Tint Color
color *= _PerCharacterTintColor.rgb;
// Add Color
color += _PerCharacterAddColor.rgb;
// Per-Character Tint & Add Color (set by NiloToonPerCharacterRenderController)
// Matching NiloToonCharacter_Shared.hlsl: color.rgb = color.rgb * _PerCharEffectTintColor + _PerCharEffectAddColor;
color.rgb = color.rgb * _PerCharEffectTintColor + _PerCharEffectAddColor;
// Desaturation (matching NiloToonCharacter_Shared.hlsl line 4099)
color = lerp(color, Luminance(color), _PerCharEffectDesaturatePercentage);
// Mul Add (already handled above with _PerCharacterTintColor and _PerCharacterAddColor)
// Replace by Color / Lerp Color (matching NiloToonCharacter_Shared.hlsl line 4105)
// Uses alpha channel of _PerCharEffectLerpColor as the lerp amount
color.rgb = lerp(color.rgb, _PerCharEffectLerpColor.rgb, _PerCharEffectLerpColor.a);

View File

@ -149,8 +149,8 @@ CBUFFER_START(UnityPerMaterial)
// Per-Character Color Controls
half _PerCharacterBaseColorMultiply;
half4 _PerCharacterBaseColorTint;
half4 _PerCharacterTintColor;
half4 _PerCharacterAddColor;
half3 _PerCharEffectTintColor; // Set by NiloToonPerCharacterRenderController
half3 _PerCharEffectAddColor; // Set by NiloToonPerCharacterRenderController
half _PerCharEffectDesaturatePercentage;
half4 _PerCharEffectLerpColor;