diff options
| author | yum <yum.food.vr@gmail.com> | 2025-04-23 16:30:01 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-04-23 16:30:01 -0700 |
| commit | 7aae547b83c94ff3ecf62524809ecb21d6061d33 (patch) | |
| tree | 8ddb859cb4a8926e553d08d120406304ca355d3c /yum_pbr.cginc | |
| parent | 4e8de4d6f93bce6d4951ad85fe4ae31b9e0cdedd (diff) | |
tweak how decal rotation works
Diffstat (limited to 'yum_pbr.cginc')
| -rw-r--r-- | yum_pbr.cginc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/yum_pbr.cginc b/yum_pbr.cginc index 662ee1c..8ecbe2a 100644 --- a/yum_pbr.cginc +++ b/yum_pbr.cginc @@ -47,7 +47,7 @@ YumPbr GetYumPbr(v2f i) { for (uint ii = 0; ii < _UV_Domain_Warping_Spatial_Octaves; ii++) { float2 noise_uv = warped_uv * frequency + time_offset; float2 offset_sample = _UV_Domain_Warping_Noise.SampleLevel(trilinear_repeat_s, noise_uv, 0).rg; - offset_sample = (offset_sample * 2.0 - 1.0); + offset_sample = (offset_sample * 2.0 - 1.0); warped_uv += offset_sample * amplitude; frequency *= lacunarity; amplitude *= persistence; @@ -78,16 +78,15 @@ YumPbr GetYumPbr(v2f i) { #endif float3 normal_tangent = UnpackScaleNormal( - tex2D(_BumpMap, UV_SCOFF(i, _BumpMap_ST, /*which_channel=*/0)), - _BumpScale); + tex2D(_BumpMap, UV_SCOFF_IMPL(raw_uv, _BumpMap_ST)), _BumpScale); #if defined(_DETAIL_MAPS) float detail_mask = _DetailMask.SampleLevel(point_repeat_s, i.uv01.xy, 0); float4 detail_albedo = tex2D(_DetailAlbedoMap, - UV_SCOFF(i, _DetailAlbedoMap_ST, /*which_channel=*/0)); + UV_SCOFF_IMPL(raw_uv, _DetailNormalMap_ST)); float3 detail_normal = UnpackScaleNormal( tex2D(_DetailNormalMap, - UV_SCOFF(i, _DetailNormalMap_ST, /*which_channel=*/0)), + UV_SCOFF_IMPL(raw_uv, _DetailNormalMap_ST)), _DetailNormalMapScale); result.albedo = lerp(result.albedo, result.albedo * detail_albedo, detail_mask); //result.albedo.a *= detail_albedo.a; |
