View shader on Shadertoy - Published on 2018-07-25
Created for the Shadertoy Competition 2018
07/29/2018 I have made some optimizations and bugfixes, so I could enable AA.
!! Please change AA (line 47) to 1 if your framerate is below 60 (or if you're running the shader fullscreen).
This shader uses motion capture data to animate a humanoid. The animation data is compressed by storing only a fraction of the coeffecients of the Fourier transform of the positions of the bones (Buffer A). An inverse Fourier transform is used to reconstruct the data needed.
Image Based Lighting (IBL) is used to render the scene. Have a look at my shader "Old watch (IBL)" (https://www.shadertoy.com/view/lscBW4) for a clean implementation of IBL.
Buffer A: I have preprocessed a (motion captured) animation by taking the Fourier transform of the position of all bones (14 bones, 760 frames). Only a fraction of all calculated coefficients are stored in this shader: the first coefficients with 16 bit precision, later coefficients with 8 bit. The positions of the bones are reconstructed each frame by taking the inverse Fourier transform of this data.
I have used (part of) an animation from the Carnegie Mellon University Motion Capture Database. The animations of this database are free to use:
Íñigo Quílez has created some excellent shaders that show the properties of Fourier transforms, for example:
Buffer B: The BRDF integration map used for the IBL and the drawing of the humanoid are precalculated.
Buffer C: Additional custom animation of the bones is calculated for the start and end of the loop.
Source: Common.glsl
Source: Buffer A.glsl
- iChannel0: Buffer A (linear, clamp, vflipped)
Source: Buffer B.glsl
- iChannel0: Buffer B (linear, clamp, vflipped)
- iChannel1: texture (mipmap, repeat, vflipped)
Source: Buffer C.glsl
- iChannel0: Buffer A (linear, clamp, vflipped)
Source: Image.glsl
- iChannel0: cubemap (mipmap, clamp, vflipped)
- iChannel1: texture (mipmap, repeat, vflipped)
- iChannel2: Buffer C (linear, clamp, vflipped)
- iChannel3: Buffer B (linear, clamp, vflipped)
- [SH18] Human Document on Shadertoy
- An overview of all my shaders
- My public profile on Shadertoy
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.