Skip to content

Instantly share code, notes, and snippets.

View mikelyndon's full-sized avatar

Mike mikelyndon

View GitHub Profile
@mikelyndon
mikelyndon / VAT.md
Created March 15, 2023 16:53
Pseudo code and notes for generating a vertex animation texture for a fixed point count deforming geometry.

Vertex Animation Textures

Prerequisites

  • Normals
  • UVs

Create orient attribute (allows us to update normals in the vertex shader)

  • Create normal (N) attribute if missing
  • Create tangentu attribute (preferably MikkT)
  • Create matrix3 from N and tangentu
  • Convert matrix3 to orient attribute (quaternion)
@mikelyndon
mikelyndon / rockAnimation.vfl
Created March 4, 2017 23:10
Code used to animate rocks shown in my GDC 2017 presentation for Sidefx.
//check the distance from the rock to the waypoint1
float distanceToWayPt1 = distance(@P,v@wayPoint1);
f@dist1 = distanceToWayPt1;
//check the distance from the rock to waypoint2
float distanceToWayPt2 = distance(@P,v@wayPoint2);
// Phase 0
// If: Start Frame has been reached
// AND the rock is further than 0.5 units from waypoint 1