diff options
| author | yum <yum.food.vr@gmail.com> | 2025-12-01 15:36:08 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-12-01 15:36:08 -0800 |
| commit | 66ea1231a2ae1c830269d7ecc2cdce78fc8e9897 (patch) | |
| tree | f4b9a628c4b3789137ad46800acc93b861ec93d1 | |
| parent | 55881602a4eaf02e7cefba8e238cd4012d55f93b (diff) | |
clamp ao
| -rw-r--r-- | decals.cginc | 5 | ||||
| -rw-r--r-- | yum_pbr.cginc | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/decals.cginc b/decals.cginc index 9d8c632..e789b62 100644 --- a/decals.cginc +++ b/decals.cginc @@ -225,7 +225,7 @@ float3 calculateSdfSsn(DecalParams params, float2 decal_uv, float4 decal_albedo) #define APPLY_DECAL_CLAMP_OFF(i, albedo, normal_tangent, metallic, smoothness, emission, params) {}
#define APPLY_DECAL_MASK_ON(i, albedo, normal_tangent, metallic, smoothness, emission, params) \
- float decal_mask = params.mask.SampleLevel(linear_repeat_s, raw_decal_uv, 0); \
+ float decal_mask = params.mask.SampleLevel(trilinear_aniso4_repeat_s, raw_decal_uv, params.mip_bias); \
decal_albedo.a *= decal_mask;
#define APPLY_DECAL_MASK_OFF(i, albedo, normal_tangent, metallic, smoothness, emission, params) \
@@ -253,9 +253,10 @@ float3 calculateSdfSsn(DecalParams params, float2 decal_uv, float4 decal_albedo) #define APPLY_DECAL_EMISSION_OFF(i, albedo, normal_tangent, metallic, smoothness, emission, params) {}
+
#define APPLY_DECAL_NORMAL_ON(i, albedo, normal_tangent, metallic, smoothness, emission, params) \
float3 decal_normal = UnpackScaleNormal( \
- params.normalTex.SampleBias(trilinear_repeat_s, decal_uv, params.mip_bias), \
+ params.normalTex.SampleBias(trilinear_aniso4_repeat_s, decal_uv, params.mip_bias), \
params.normal_scale * decal_albedo.a * params.opacity); \
normal_tangent = blendNormalsHill12(normal_tangent, decal_normal);
//normal_tangent = lerp(normal_tangent, decal_normal, decal_albedo.a * params.opacity);
diff --git a/yum_pbr.cginc b/yum_pbr.cginc index b6969f7..f70f056 100644 --- a/yum_pbr.cginc +++ b/yum_pbr.cginc @@ -235,6 +235,7 @@ YumPbr GetYumPbr(v2f i, float3x3 tangentToWorld) { #if defined(_AMBIENT_OCCLUSION) result.ao = lerp(1, tex2D(_OcclusionMap, i.uv01), _OcclusionStrength); + result.ao = saturate(result.ao); #else result.ao = 1; #endif |
