Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type spatial;
- render_mode cull_disabled, unshaded;
- uniform vec3 velocity = vec3(0.0, 10.0, -15.0);
- uniform float gravity = 9.8;
- uniform float slices = 20.0;
- uniform float scale = 5.0;
- uniform float duration = 2.0;
- void vertex() {
- // we'll be calculating our own vertex
- VERTEX.x = 0.0;
- VERTEX.y = VERTEX.z;
- VERTEX.z = 0.0;
- // use UV.x to determine time
- float t = UV.x * duration;
- // apply our velocity
- VERTEX += velocity * t;
- // apply our gravity
- VERTEX.y -= 0.5 * gravity * t * t;
- }
- void fragment() {
- // discard our fragment at intervals
- if (mod(UV.x * slices - TIME * scale, 1.0) > 0.5) {
- discard;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement