summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-11-07 18:50:45 -0800
committeryum <yum.food.vr@gmail.com>2025-11-07 18:50:45 -0800
commite7008baac77c82d2865e0d54928269528be034d2 (patch)
tree32e1f427a7b84102e8d7aea969517b1836d34381 /yum_pbr.cginc
parent0e0641580d9b492c90e6257baad4d28670d0bae2 (diff)
meow
Diffstat (limited to 'yum_pbr.cginc')
-rw-r--r--yum_pbr.cginc7
1 files changed, 4 insertions, 3 deletions
diff --git a/yum_pbr.cginc b/yum_pbr.cginc
index 5baff19..b6969f7 100644
--- a/yum_pbr.cginc
+++ b/yum_pbr.cginc
@@ -195,12 +195,13 @@ YumPbr GetYumPbr(v2f i, float3x3 tangentToWorld) {
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);
+ float2 detail_uv = get_uv_by_channel(i, _Detail_Maps_UV_Channel);
+ float detail_mask = _DetailMask.SampleLevel(point_repeat_s, detail_uv, 0);
float4 detail_albedo = tex2D(_DetailAlbedoMap,
- UV_SCOFF_IMPL(raw_uv, _DetailNormalMap_ST));
+ UV_SCOFF_IMPL(detail_uv, _DetailAlbedoMap_ST));
float3 detail_normal = UnpackScaleNormal(
tex2D(_DetailNormalMap,
- UV_SCOFF_IMPL(raw_uv, _DetailNormalMap_ST)),
+ UV_SCOFF_IMPL(detail_uv, _DetailNormalMap_ST)),
_DetailNormalMapScale);
result.albedo = lerp(result.albedo, result.albedo * detail_albedo, detail_mask);
//result.albedo.a *= detail_albedo.a;