SketchpunkLabsThis is a big subject, so I'm breaking the lesson out as two parts. In the first part I'm going to try to explain shaders, the parts that make it up and using VAO's to make using shaders easier.
Then in the second part I'll walk you through some of the new code in which we start creating our shader base class and setting up vao as our mesh data structure.
Fun with WebGL 2.0 : 003 : The Shaders Part 1SketchpunkLabs2017-01-21 | This is a big subject, so I'm breaking the lesson out as two parts. In the first part I'm going to try to explain shaders, the parts that make it up and using VAO's to make using shaders easier.
Then in the second part I'll walk you through some of the new code in which we start creating our shader base class and setting up vao as our mesh data structure.
======================================================
GitHub :: https://github.com/sketchpunk Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137.6 : IK Rigs - Head & SpringsSketchpunkLabs2020-04-25 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137.5 : IK Rigs - SpineSketchpunkLabs2020-04-25 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137 : IK Rig - GroundingSketchpunkLabs2020-04-24 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137.2 : IK Rigs - LimbsSketchpunkLabs2020-04-22 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137.1 : IK Rig - HipsSketchpunkLabs2020-04-21 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 137.0 : IK Rigs IntroSketchpunkLabs2020-04-21 | This is a mini series in where i break down the IK Rigs system I developed that was inspired by Ubisoft's GDC talk about their own IK Rigs. The main goal is to be able to read an animation, translate each pose into a set of IK bits of data that we can then apply to various other meshes without being remotely similar to the animation's own skeleton.
To prove that point, we use a humanoid model thats shorter then our source to use as a simple baseline translation from one human to another. Then we also use a Robot dinosaur which is very different from the source. For example, human src have a 2 bone leg but dino has 3, so we end up using various IK Solvers to deal with different bone configurations. Then there's a tail which there is no animation data for it, so we use springs to procedurally move extra parts based on the movement the model is able to replicate. There are other differences that the dino skeleton has but by the end you'll see its possible to translate human motion into an animal body.
This is really just the beginning of IK Rigs. With the hard part out of the way, we can then explore other various things from the GDC talk further the development of IK Rigs which will eventually become future tutorials. So I welcome all to this new journey.
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 136 : Quaternion Swing and TwistSketchpunkLabs2020-04-09 | This is the second video in relation to IK Animation. Before dealing with IK stuff, I want to go through a few math ideas that I found to be important when trying to animate characters with IK. This second one is about breaking rotation into a set of 2 rotations that makes it easy to store and translate to IK Bones. The basic idea is to swing a bone to face a specific direction, then apply a roll / twist, for example swing your arm then just rotating just your wrist. Saving data as a direction vector plus an angle of rotation for the twist makes it pretty easy to store in a vec4 data type and works pretty well to share overall animation to various ik rigs.
======================================================
Links of Interest
======================================================
GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 135 : Quaternion Inverse DirectionSketchpunkLabs2020-03-22 | This is the first video in relation to IK Animation. Before dealing with IK stuff, I want to go through a few math ideas that I found to be important when trying to animate characters with IK. The first one i'm calling "Quaternion Inverse Direction", because I have no better name for it since I noticed this after a few failed attempts of IK animation. The main idea is to try to create a universal direction no matter what rotational orientation all your objects exist in.
KEEP IN MIND. WebGPU is still being developed as I write this, so the code contained here may break at some point when the api gets changed around. This happened in the middle of developing this first lesson :)
====================================================== GitHub :: https://github.com/sketchpunk/webgl2webgpu Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 134 : Data Texture Skin AnimationSketchpunkLabs2019-11-10 | So we retargeted some animation and managed to save it back out as a GLTF file to reuse. So lets try something different. Lets take our animation and transform it into something that will be usable on the GPU, then store all this data into a texture buffer. So why do this? Well, we can store boat loads of information in a texture plus we have random access to the data. So if we're smart in saving our data as Pixels, we can move all our skin animation code into a shader that will do all the work on the gpu. So no more figuring out the world space position / rotation for every bone for every frame, all that will be cached onto a texture and we'll no longer need to recalculate the animation again, victory.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 133 : Saving Retargeted AnimationSketchpunkLabs2019-11-10 | In the last video we explored how to retarget animation from one character onto another. In this video we're going to continue by saving the data back out into a new GLTF json & bin file so we can run the animations on our target meshes without redoing the retargeting. We're going to step through the process of creating a new animation object from our retargeting, then step through a custom made GLTF export to save out the animation and its armature. Then finally we learn how to generate JSON and Binary files in javascript and start a download process to save the files onto your desktop without any backend servers, purely client side file saving.
====================================================== Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabsWebGL2 : 132 : Animation RetargetingSketchpunkLabs2019-10-03 | In today's video we're going to explore an advanced topic, Animation retargeting. The idea is to map the bones of two similar skeletons and transform all the rotation of one onto the other. The purpose to be able to reuse animation with different models and characters.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 131 : Soft Body PhysicsSketchpunkLabs2019-09-21 | Today we continue from the last lesson, where we did all our springs computation on the gpu. Springs are used to help simulate soft body physics and one component need to help is a bit of collision. So we're going to deal with a bit of collision detection in our computer shader and when the collision is released our mesh will spring back to its resting position. We'll explore floor collision, sphere to sphere and end with using ray intersection to add a big of push to our test vegeta mesh.
====================================================== Links of Interest
Project files can be found on github, but if you want the tentacle example, its available as a free download at my patreon page. https://www.patreon.com/posts/29203274
From there, you get the angle between 2 rays. Bone's head to the Trail's resting position, then from the bone's head to the following point. With the angle at hand, all we need to do is get the cross product of the two rays to get an axis of rotation. Angle plus Axis, we can easily create a quaternion that we can apply to the bind pose rotation of the bone for a final springy bone movement. It sounds complicated, but the code is fairly simple. I also setup visual aids to help drive the concept home for most people.
We also continue to build our baller controller since the last video. We use spring rotation to control the movement of the plunger gun that is attached to the sphere.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 126 : Spring MovementSketchpunkLabs2019-07-08 | In this lesson we explore a bit of spring physics. We'll focus on on equations based on 1D movement to keep things super simple, but like curves, its requires little to no effort to expand it to 2D or 3D. We'll cover a few different examples of the math I found, also discuss a few different examples of how to apply delta time to spring movement. We'll end by checking out an example of how to calculate the Spring Constant and Damping based on a few inputs like start/end positions, how much time to cover the distances and how many bounces you want the spring to do.
The hopes of this lesson is to get a basic well rounded idea of how to handle springs. This will be the first lesson of a mini series related to the topic. Future tutorials will hope to cover: - Spring Rotation - Spring Bone (Jiggly Bone) - Spring Bone Chains (Hair, Clothing, etc) - Soft Body Physics
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 125 : Procedural IK Dance P2SketchpunkLabs2019-06-28 | Now with much of our IK system built, we're going to explore recreating an example of procedural animated dance. Its something I found a long while back when I first started to learn about ik. Its a pretty cool experiment done in unity that depends on its IK system and various other things that exists in the C# language. So we'll step though building a simple version purely with javascript and webgl. This is a fun example of building a semi complicated procedural animation.
In the second part, we're going to focus on moving the spine and the arms. ====================================================== Links of Interest https://github.com/keijiro/PuppetTest
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 125 : Procedural IK Dance P1SketchpunkLabs2019-06-28 | Now with much of our IK system built, we're going to explore recreating an example of procedural animated dance. Its something I found a long while back when I first started to learn about ik. Its a pretty cool experiment done in unity that depends on its IK system and various other things that exists in the C# language. So we'll step though building a simple version purely with javascript and webgl. This is a fun example of building a semi complicated procedural animation.
In this first part we're going to focus on getting the feet moving while the hips oscillates up and down.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 122 : IK Solver AimSketchpunkLabs2019-05-24 | In previous lessons related to inverse kinematics we only worked with simple bones but when applying those examples to meshes with complete skeletons things don't render very well. In the next set of video we're going to dive into doing IK with actual skinned meshes and some of the extra steps needed and things to watch out for. To start with we're going to dive into what I'm calling the IK Aiming. The idea is to properly aim a limb at the end effector while trying to keep its orientation while applying a twist to control the direction the elbow or knee points to. This will be the starting point for the rebuilding of our IK solvers from pass videos.
====================================================== Links of Interest
Update : Learned that this sort of thing has a technical term, Prismatic. So for future videos you will see piston replaced with the word Prismatic.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/WebGL2 : 117 : Arc Circle IK SolverSketchpunkLabs2018-10-08 | Continuing procedural animations with inverse kinematics, we explore a solver I put together that arcs the bones towards the target. The distance will determine if the bones will be rotated on an arc or more like a circle. This is great for tentacles or whatever else you can come up with. This is the second of 4 solvers that will be part of our ubisoft's recreation of IK Rigs.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/WebGL2 : 116 : Wagging animation with IK ChainsSketchpunkLabs2018-10-04 | In today's video we're going to continue building up our armature system by creating something called Chains. These are just array of bones that allows us to group animations for our future rigs. We'll explore how to animate our chain with a swaying / wagging sort of animation then playing around with its values and even hack the function a bit to see what else we can do when we generate the animation at runtime. Then we end off generating two poses for our chains then lerping between them as another approach to animating our chains.
====================================================== Links of Interest
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/WebGL2 : 115 : ECS Bone/Joint EntitySketchpunkLabs2018-10-03 | Today we're going to rebuild part of our armature system where the bones / joints will become ECS entities. Before, our system was built as a self contained system but that leaves us with limitations. By allowing our bones to exist as entities in the system, we can do entity type things like adding components to it, we can easily attach children to bones like sockets. This sets us up to do future thing like adding physics to our bones. While we're add it, we're going to add 3 axis scaling to our bones, so we can control how our bones scale in the future.
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/WebGL2 : 114 : Pure TransformSketchpunkLabs2018-10-03 | In today's video we're going to explore trying to do Transforms without Matrices. We look at a concept from a blog post then take it a step further and push the transform data to our shader and apply it to our vertices without the need of turning our transform (rotation, position, scale) into model matrix. The only tricky bit is applying quaternion rotation but we already covered GLSL code to just that, so its not difficult to complete the task.
====================================================== Links of Interest
====================================================== GitHub :: https://github.com/sketchpunk/FunWithWebGL2 Patreon :: https://www.patreon.com/sketchpunk Twitter :: https://twitter.com/SketchpunkLabs Tumblr :: http://sketchpunklabs.tumblr.com/ Trello :: https://trello.com/b/zcTUPpFy/fun-with-webgl-20WebGL2 : 110 : Inverse Kinematics with Curve PlacementSketchpunkLabs2018-08-16 | In the attempt of recreating IK-Rigs, we explore different ways to go about doing Inverse kinematics beyond just FABIK or just adding to it. We explore how to easily do a two joint chain like Arms and legs just by doing a bit of triangle math to create reach that does not need FABIK to work. Then we try augmenting FABIK by apply curves while trying to reach for an object. I go through using catenary, circular and sine curves which gives us different ways to reach for an object and how to handle chains that are longer then 2 joints.