diff options
| author | yum <yum.food.vr@gmail.com> | 2026-04-10 16:56:31 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-04-10 16:56:31 -0700 |
| commit | 2e499c581dcd307c894014539514a07a4ee7808c (patch) | |
| tree | 6bf5fda1789b938d0c3e27e1620119f77820da71 | |
| parent | 89debfe865f83e5315f51122e3ec5579d5b9d53d (diff) | |
Add uv channel to glitter
| -rwxr-xr-x | 3ner.shader | 1 | ||||
| -rw-r--r-- | data.cginc | 1 | ||||
| -rwxr-xr-x | globals.cginc | 1 | ||||
| -rwxr-xr-x | lighting.cginc | 2 |
4 files changed, 4 insertions, 1 deletions
diff --git a/3ner.shader b/3ner.shader index d3937bb..8cc0c96 100755 --- a/3ner.shader +++ b/3ner.shader @@ -706,6 +706,7 @@ Shader "yum_food/3ner" [IntRange] _Glitter_Angular_Cells("Angular Cells", Range(1, 4)) = 4 _Glitter_Filter_Size("Filter Size", Range(0.1, 2.0)) = 0.7 _Glitter_Tint("Tint", Color) = (1, 1, 1, 1) + [IntRange] _Glitter_UV_Channel("UV Channel", Range(0, 3)) = 0 //ifex _Glitter_Mask_Enabled==0 [HideInInspector] m_start_Glitter_Mask("Mask", Float) = 0 @@ -97,6 +97,7 @@ struct LightData { LightDirect direct; LightIndirect indirect; #if defined(_GLITTER) + float2 glitter_uv; LightGlitter glitter; #endif }; diff --git a/globals.cginc b/globals.cginc index b5f0418..93c58e0 100755 --- a/globals.cginc +++ b/globals.cginc @@ -158,6 +158,7 @@ float _Glitter_Roughness; int _Glitter_Angular_Cells; float _Glitter_Filter_Size; float3 _Glitter_Tint; +float _Glitter_UV_Channel; #endif // _GLITTER #if defined(_GLITTER_MASK) diff --git a/lighting.cginc b/lighting.cginc index 6653bba..b883bed 100755 --- a/lighting.cginc +++ b/lighting.cginc @@ -287,7 +287,7 @@ void GetLighting(v2f i, Pbr pbr, out LightData data) { #endif data.glitter = GetGlitterLighting( _Glitter_Amount, _Glitter_Roughness, _Glitter_Angular_Cells, - _Glitter_Filter_Size, i.uv01.xy, pbr.tbn, glitter_roughness, pbr.normal, + _Glitter_Filter_Size, UV_SCOFF(i, _Glitter_Mask_ST, _Glitter_UV_Channel), pbr.tbn, glitter_roughness, pbr.normal, data.common.V, data.direct.H, glitter_indirect_dir); #endif |
