diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-21 16:03:52 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-21 16:03:52 -0800 |
| commit | 97ee1dcf26b62f48e351b6392c11a30775619442 (patch) | |
| tree | 034c7d64461fa5766deb7df6a0f4737f58eaec8c /2ner.cginc | |
| parent | e54c87201b97fb36ef9c0e63f9e0012ac59f2f0b (diff) | |
Fur: add domain warping
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -257,7 +257,7 @@ void geom(triangle v2f input[3], inout TriangleStream<v2f> stream) { o.vertexLight.w = t;
stream.Append(o);
}
- stream.RestartStrip();
+ // We do not restart strips. Looks a little nicer.
}
#else
stream.Append(input[0]);
@@ -294,6 +294,11 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace f.binormal = cross(i.tangent, i.normal);
f.eyeVec = i.worldPos - _WorldSpaceCameraPos;
f.viewDir = normalize(f.eyeVec);
+ f.tbn = float3x3(
+ i.tangent,
+ f.binormal,
+ i.normal
+ );
#if defined(_RAYMARCHED_FOG)
{
@@ -429,19 +434,12 @@ float4 frag(v2f i, uint facing : SV_IsFrontFace #endif
#endif
- float4x4 tangentToWorld = float4x4(
- float4(i.tangent, 0),
- float4(f.binormal, 0),
- float4(i.normal, 0),
- float4(0, 0, 0, 1)
- );
-
float ssao = 1;
#if defined(_SSAO)
float2 debug;
- ssao = get_ssao(i, tangentToWorld, debug);
+ ssao = get_ssao(i, f, debug);
#endif
- YumPbr pbr = GetYumPbr(i, f, tangentToWorld);
+ YumPbr pbr = GetYumPbr(i, f);
pbr.albedo.rgb *= ssao;
#if defined(META_PASS)
|
