swift502 / Sketchbook

3D playground built on three.js and cannon.js.
https://jblaha.art/sketchbook/latest
MIT License
1.47k stars 389 forks source link

upgrading webpack version #46

Closed vivasvan1 closed 1 year ago

vivasvan1 commented 2 years ago

Hi Swift502,

First of all thanks for your help on the CSM issue again. 👍🏽 Love your work.

Secondly, I am making this PR for upgrading the versions of the libraries before working on other features. I am kind of new to open-source so would love your guidance here as well.

I will seperate this into 4-5 commits something like:

Best wishes, Vivasvan

swift502 commented 2 years ago

Heyyy. This looks really cool. This PR might finally convince me to update a couple of things I thought I wanted to put in the project, but weren't substantial enough on their own.

Did you actually manage to fix animation blending in new versions of three.js? That would be amazing and I would definitely want to merge this.

Just please be patient with me. It might take some time to get it approved, it's a lot of changes and I haven't seen most of this code in literally 4 years. Whoops. 😅

swift502 commented 2 years ago

And yeah, technically this PR looks great. I won't merge until I get an Okay from you that it's ready. I see that you're still working on porting cannon.

vivasvan1 commented 2 years ago

Did you actually manage to fix animation blending in new versions of three.js? That would be amazing and I would definitely want to merge this.

I confess, unfortunatly, I kind of found a hacky solution :/ which seems to work but i am kind of unhappy about it.

So,

I felt there we 2 issues in the animation thing: 1) mixer.stopAllAction() has changed from letting the existing actions to fadeOut to removing all scheduled fadeIns,fadeOuts, etc. (still not documented in migration guide of threejs) 2) Animation which are not designed to loop are looping. (example, drop_idle animation)

I wrote this codepen to see if the animationAction can work with controls like we have written with fadeOut and fadeIn logic. And it seemed to work fine.

So i replaced the stopAllAction with for loop of fadeOuts to all actions.

the animation still felt NOT to be working smoothly which i felt was because of animation loop of non-loopable animations. So i made the animation speed's slightly slower and it kind of works like that.

action.setEffectiveTimeScale(0.7); Which slows the animations but it atleast didnt glitch like before.

I suspect its because of update being called too fast with the new version of libraries for some reason and the animations starts looping faster than it should.

Anyway, hope this info helps.

vivasvan1 commented 2 years ago

And yeah, technically this PR looks great. I won't merge until I get an Okay from you that it's ready. I see that you're still working on porting cannon.

Yes I would like to get the cannon-es into the package.json before merging this. I'll keep you posted on it ))

vivasvan1 commented 1 year ago

Hi @swift502. Happy new year. Hope u doing good.

Just catching up after some time

swift502 commented 1 year ago

@vivasvan1 hey please check your discord messages.