diff options
| author | yum <yum.food.vr@gmail.com> | 2024-10-07 14:41:33 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-10-07 14:41:33 -0700 |
| commit | e51760ab5e6d698b26b60e1811e7afce62be55d0 (patch) | |
| tree | b7bb304f703f47958ce59ebf906f6f5ad6ca4480 /tooner_lighting.cginc | |
| parent | 144d7bc5cc999b9c5f84a9a7fc2a86dafe276df1 (diff) | |
Fix center eye toggle in rim lighting
Also add bayer dithering logic (not used yet).
Diffstat (limited to 'tooner_lighting.cginc')
| -rw-r--r-- | tooner_lighting.cginc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc index ad42fa9..6d70dbc 100644 --- a/tooner_lighting.cginc +++ b/tooner_lighting.cginc @@ -1276,6 +1276,7 @@ float4 effect(inout v2f i) const float3 view_dir = normalize(_WorldSpaceCameraPos.xyz - i.worldPos); const float3 view_dir_c = normalize(i.centerCamPos - i.worldPos); #define VIEW_DIR(center_eye_fix) (center_eye_fix == 1 ? view_dir_c : view_dir) +#define CAM_POS(center_eye_fix) (center_eye_fix == 1 ? i.centerCamPos : _WorldSpaceCameraPos.xyz) // Not necessarily normalized after interpolation. i.normal = normalize(i.normal); @@ -1740,7 +1741,7 @@ float4 effect(inout v2f i) #if defined(_RIM_LIGHTING0_GLITTER) float rl_glitter = get_glitter( get_uv_by_channel(i, round(_Rim_Lighting0_Glitter_UV_Select)), - i.worldPos, i.centerCamPos, normal, + i.worldPos, CAM_POS(_Rim_Lighting0_Center_Eye_Fix), normal, _Rim_Lighting0_Glitter_Density, _Rim_Lighting0_Glitter_Amount, _Rim_Lighting0_Glitter_Speed, /*mask=*/1, /*angle=*/91, /*power=*/1); @@ -1831,7 +1832,7 @@ float4 effect(inout v2f i) #if defined(_RIM_LIGHTING1_GLITTER) float rl_glitter = get_glitter( get_uv_by_channel(i, round(_Rim_Lighting1_Glitter_UV_Select)), - i.worldPos, i.centerCamPos, normal, + i.worldPos, CAM_POS(_Rim_Lighting1_Center_Eye_Fix), normal, _Rim_Lighting1_Glitter_Density, _Rim_Lighting1_Glitter_Amount, _Rim_Lighting1_Glitter_Speed, /*mask=*/1, /*angle=*/91, /*power=*/1); @@ -1922,7 +1923,7 @@ float4 effect(inout v2f i) #if defined(_RIM_LIGHTING2_GLITTER) float rl_glitter = get_glitter( get_uv_by_channel(i, round(_Rim_Lighting2_Glitter_UV_Select)), - i.worldPos, i.centerCamPos, normal, + i.worldPos, CAM_POS(_Rim_Lighting2_Center_Eye_Fix), normal, _Rim_Lighting2_Glitter_Density, _Rim_Lighting2_Glitter_Amount, _Rim_Lighting2_Glitter_Speed, /*mask=*/1, /*angle=*/91, /*power=*/1); @@ -2014,7 +2015,7 @@ float4 effect(inout v2f i) #if defined(_RIM_LIGHTING3_GLITTER) float rl_glitter = get_glitter( get_uv_by_channel(i, round(_Rim_Lighting3_Glitter_UV_Select)), - i.worldPos, i.centerCamPos, normal, + i.worldPos, CAM_POS(_Rim_Lighting3_Center_Eye_Fix), normal, _Rim_Lighting3_Glitter_Density, _Rim_Lighting3_Glitter_Amount, _Rim_Lighting3_Glitter_Speed, /*mask=*/1, /*angle=*/91, /*power=*/1); |
