summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--2ner.cginc2
-rw-r--r--UnityStandardMeta.cginc7
-rw-r--r--yum_pbr.cginc4
3 files changed, 9 insertions, 4 deletions
diff --git a/2ner.cginc b/2ner.cginc
index 0b5ee9f..0df4f17 100644
--- a/2ner.cginc
+++ b/2ner.cginc
@@ -254,7 +254,7 @@ void geom(triangle v2f input[3], inout TriangleStream<v2f> stream) {
o.worldPos.xyz += normal_ws * offset;
o.objPos.xyz += o.normal * offset;
o.pos = UnityWorldToClipPos(o.worldPos);
- o.vertexLight.w = layer;
+ o.vertexLight.w = t;
stream.Append(o);
}
stream.RestartStrip();
diff --git a/UnityStandardMeta.cginc b/UnityStandardMeta.cginc
index 89fcb61..60eedc9 100644
--- a/UnityStandardMeta.cginc
+++ b/UnityStandardMeta.cginc
@@ -108,8 +108,13 @@ float4 frag_meta (v2f_meta i) : SV_Target
#if defined(V2F_COLOR)
pbr_input.color = i.color;
#endif
+
+ f2f f = (f2f) 0;
+ f.binormal = cross(i.tangent, i.normal);
+ f.eyeVec = i.worldPos - _WorldSpaceCameraPos;
+ f.viewDir = normalize(f.eyeVec);
- YumPbr pbr = GetYumPbr(pbr_input, tangentToWorld);
+ YumPbr pbr = GetYumPbr(pbr_input, f, tangentToWorld);
#if defined(_CUSTOM30)
#if defined(_CUSTOM30_BASICCUBE)
diff --git a/yum_pbr.cginc b/yum_pbr.cginc
index a9e65d6..f9a29c3 100644
--- a/yum_pbr.cginc
+++ b/yum_pbr.cginc
@@ -145,7 +145,7 @@ float FurClip(v2f i, f2f f, inout YumPbr result) {
float fur_thickness = _Fur_Heightmap.SampleBias(
trilinear_aniso4_repeat_s, fur_uv,
_Fur_Heightmap_Mip_Bias).r;
- clip(fur_thickness - fur_layer / _Fur_Layers);
+ clip(fur_thickness - fur_layer);
return fur_thickness;
#else
return 0;
@@ -258,7 +258,7 @@ YumPbr GetYumPbr(v2f i, f2f f, float3x3 tangentToWorld) {
#endif
#if defined(_FUR)
- result.ao = lerp(result.ao, 0, fur_thickness * _Fur_AO_Strength);
+ result.ao = lerp(result.ao, result.ao * fur_thickness, _Fur_AO_Strength);
#endif
applyDecals(i, result.albedo, normal_tangent, result.metallic, result.smoothness, result.emission);