diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-19 18:40:39 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-19 18:40:39 -0800 |
| commit | 0ef282da6a87c27e4056faaedb2847eed1f5a8a7 (patch) | |
| tree | 3eaf26a8216f0efc94edc1499e0ab9241b5aac83 /tessellation.cginc | |
| parent | f6e54271cddfec5ef16e986a94edf2db380bc458 (diff) | |
shadows now use pbr normal; reparameterize tesellation falloff
Diffstat (limited to 'tessellation.cginc')
| -rw-r--r-- | tessellation.cginc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tessellation.cginc b/tessellation.cginc index fdfc3b2..c964598 100644 --- a/tessellation.cginc +++ b/tessellation.cginc @@ -118,9 +118,14 @@ tess_factors patch_constant(InputPatch<v2f, 3> patch) { float edgeLength = _Tessellation_Factor; - f.edge[2] = l01 * edgeLength; - f.edge[0] = l12 * edgeLength; - f.edge[1] = l20 * edgeLength; + float edge01 = l01 * edgeLength; + float edge12 = l12 * edgeLength; + float edge20 = l20 * edgeLength; + + float k = _Tessellation_Falloff_Factor; + f.edge[0] = min(_Tessellation_Factor, k * edge12); + f.edge[1] = min(_Tessellation_Factor, k * edge20); + f.edge[2] = min(_Tessellation_Factor, k * edge01); f.inside = (f.edge[0] + f.edge[1] + f.edge[2]) * 0.333333f; #else |
