diff options
Diffstat (limited to 'vertex.cginc')
| -rwxr-xr-x | vertex.cginc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vertex.cginc b/vertex.cginc index 77412a9..2e0c1dd 100755 --- a/vertex.cginc +++ b/vertex.cginc @@ -15,6 +15,7 @@ #define OPCODE_FBM 8 #define OPCODE_PLANE_TO_HEMI_OCTAHEDRON 9 #define OPCODE_HEMI_OCTAHEDRON_TO_PLANE 10 +#define OPCODE_SCALE 11 #if defined(_VERTEX_DEFORMATION) @@ -182,6 +183,19 @@ void apply_hemi_octahedron_to_plane_normal(inout float3 objPos, inout float3 obj hemi_octahedron_to_plane_normal(objPos, objNorm, objTan, p, r, s, t); } +void apply_scale(inout float3 objPos, float4 v0, float f0) { + float3 k = v0.xyz; + float t = f0; + objPos = scale(objPos, k, t); +} + +void apply_scale_normal(inout float3 objPos, inout float3 objNorm, + inout float3 objTan, float4 v0, float f0) { + float3 k = v0.xyz; + float t = f0; + scale_normal(objPos, objNorm, objTan, k, t); +} + void deform(inout float3 objPos) { const float t = getTime(); @@ -420,6 +434,9 @@ void deform(inout float3 objPos) { case OPCODE_HEMI_OCTAHEDRON_TO_PLANE: apply_hemi_octahedron_to_plane(objPos, v0, v1, v2, f0); break; + case OPCODE_SCALE: + apply_scale(objPos, v0, f0); + break; } } } @@ -665,6 +682,9 @@ void deform_normal(inout float3 objPos, inout float3 objNorm, inout float3 objTa case OPCODE_HEMI_OCTAHEDRON_TO_PLANE: apply_hemi_octahedron_to_plane_normal(objPos, objNorm, objTan, v0, v1, v2, f0); break; + case OPCODE_SCALE: + apply_scale_normal(objPos, objNorm, objTan, v0, f0); + break; } } } |
