From 82b36c1c14013e82e15ca48dc766eb7aa4198e63 Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 18 Jul 2024 15:23:14 -0700 Subject: Add individual lighting multipliers ... for direct, indirect x {specular,diffuse} --- tooner_lighting.cginc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'tooner_lighting.cginc') diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc index e11f0dc..ec3e22b 100644 --- a/tooner_lighting.cginc +++ b/tooner_lighting.cginc @@ -112,19 +112,17 @@ v2f vert(appdata v) #if !defined(_SCROLL) && defined(_GIMMICK_SHEAR_LOCATION) if (_Gimmick_Shear_Location_Enable_Dynamic) { float3 p = v.vertex.xyz; + + float r = 0.0; + float3 sc = lerp( + _Gimmick_Shear_Location_Strength.xyz, + 1, + abs(p) < r); + float3x3 shear_matrix = float3x3( - _Gimmick_Shear_Location_Strength.x, 0, 0, - 0, _Gimmick_Shear_Location_Strength.y, 0, - 0, 0, _Gimmick_Shear_Location_Strength.z); -#if 0 - float3x3 rot_fix, rot_fixi; - float4x4 ts_fix, ts_fixi; - getMeshRendererMatrices(/*invert=*/false, rot_fix, ts_fix); - getMeshRendererMatrices(/*invert=*/true, rot_fixi, ts_fixi); - if (_Gimmick_Shear_Location_Mesh_Renderer_Fix) { - p = mul(ts_fixi, float4(p, 1)).xyz; - } -#endif + sc.x, 0, 0, + 0, sc.y, 0, + 0, 0, sc.z); p = mul(shear_matrix, p); v.vertex.xyz = p; } -- cgit v1.2.3