uniform float amp; uniform float freq; uniform float timeScale; // position and normal are in model coordinates // color is SRGB void getProceduralVertex(inout vec4 position, inout vec4 color, inout vec2 texCoord0, inout vec3 normal) { vec4 morphPosition = vec4(position.x + amp * sin((freq * position.x) + (timeScale * iGlobalTime)), position.y + amp * sin((freq * position.y) + (timeScale * iGlobalTime)), position.z + amp * sin((freq * position.z) + (timeScale * iGlobalTime)), 1); vec4 morphColor = vec4(0.5 * sin((freq * position.x) + (timeScale * iGlobalTime)) + 0.5, 0.5 * sin((freq * position.y) + (timeScale * iGlobalTime)) + 0.5, 0.5 * sin((freq * position.z) + (timeScale * iGlobalTime)) + 0.5, 1); position = morphPosition; color = morphColor; }