Skip to content

Commit

Permalink
Skinned Mesh Example (#349)
Browse files Browse the repository at this point in the history
* eod

* late lunch

* Can't figure out what's wrong with vertPositions or indices

* committing to fix an issue in another branch

* Have some kind of animation working, but not correctly

* Safety commit

* Elongated trunk'

* Scene stuff working, even though it took too long

* eod. should have finished today

* almuerzo

* Whale seems to be transformed by node values, but now it is in a weird position that I don't think I initially intended

* Remember to try to add static bgLayout to GLTFSKIN, so layout can be accessed from both main and glbUtils.ts

* Some kind of animation is happening, though not the kind I like. I think this needs to be vastly oversimplified to be less generalizable and more focused on the specific mesh and skin we want to target. Which means getting rid of a lot of class shennanigins outside the Mesh -> Primitive -> Accessor pipeline probably

* Changed get matrix to apply rotationMatrix to transformationMatrix rather than overriting the transformationMatrix with the value of the rotationMatrix : (

* Fixed it again :(

* Simplified primitive generation and rendering

* Fixed bug where texcoords were not being loaded in, even though they are not used, which caused interpretation errors with the joints and weights 🤦

* Remove gltf.ts comments

* Fix to the way our buffer is interpreted

* Fixed various errors with typedArray/ArrayBuffer interpretation in conversion of mat4x4<f32> joint data from a uint8array to a mat4 reducible float32array

* Generally seems to be working but something is off with the scaling in the animSkin function, causing the whale to be very droopy and elongated

* This is pretty dumb but I think it's working now

* Make initial angle less annoying

* Initial description

* Proper attribution for parts of glbUtils code

* Just removed console.logs

* Modified grid and gtlf shaders to take in inverseBindMatrices through uniform buffers rather than calculating them against jointMatrices on the CPU side. Also added additional comments and renamed vertex attributes in grid.wgsl to conform more closely to their counterparts in gltf.wgsl

* Removed unneeded jointMatrices code'

* Removed camera controls

* clamped angle to lower value to prevent animations that look broken/too silly

* converted uniform matrix buffers to storage buffers

* eod

* interpret vertex formats from attributes to make shaders for other glbs easier to write

* fix prettier problem

* Changed animation

* Comments and deletions
  • Loading branch information
cmhhelgeson authored Feb 28, 2024
1 parent f4b46f0 commit 41f3e5c
Show file tree
Hide file tree
Showing 9 changed files with 2,221 additions and 0 deletions.
Binary file added public/assets/gltf/whale.glb
Binary file not shown.
1 change: 1 addition & 0 deletions src/pages/samples/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const pages: PageComponentType = {
'A-buffer': dynamic(() => import('../../sample/a-buffer/main')),
bitonicSort: dynamic(() => import('../../sample/bitonicSort/main')),
normalMap: dynamic(() => import('../../sample/normalMap/main')),
skinnedMesh: dynamic(() => import('../../sample/skinnedMesh/main')),
};

function Page({ slug }: Props): JSX.Element {
Expand Down
Loading

0 comments on commit 41f3e5c

Please sign in to comment.