diff options
| author | yum <yum.food.vr@gmail.com> | 2025-03-25 18:21:18 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-03-25 18:21:18 -0700 |
| commit | ccdda956f7de812bb9c318161c6852301a60d413 (patch) | |
| tree | e98f2576f4828f7b895ac2c8044c6042cf329300 /2ner.cginc | |
| parent | f46f3023bb716950db30b48c245c82ad2d6ad2a3 (diff) | |
Add spherize feature
Diffstat (limited to '2ner.cginc')
| -rw-r--r-- | 2ner.cginc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -70,6 +70,16 @@ v2f vert(appdata v) { shatterWaveVert(v.vertex.xyz, v.normal, v.tangent);
#endif
+#if defined(_SPHERIZE)
+ {
+ float3 tgt_normal = normalize(v.vertex.xyz);
+ float3 tgt_tangent = normalize(float3(tgt_normal.y, -tgt_normal.x, 0));
+ float3 tgt_pos = tgt_normal * _Spherize_Radius;
+ v.normal = normalize(lerp(v.normal, tgt_normal, _Spherize_Strength));
+ v.vertex.xyz = lerp(v.vertex.xyz, tgt_pos, _Spherize_Strength);
+ }
+#endif
+
#if defined(OUTLINE_PASS)
[branch]
if (!_Outlines_Enabled_Dynamic) {
|
