astro-simulations icon indicating copy to clipboard operation
astro-simulations copied to clipboard

Sun Motion sim: Add fixes for current version of three.js

Open nikolas opened this issue 2 years ago • 5 comments

There have been many three.js changes since this app was last built - these required some changes in our code to fix the scene up.

https://github.com/mrdoob/three.js/wiki/Migration-Guide

nikolas avatar Aug 31 '23 14:08 nikolas

Don't know if we want to keep it but the shadowed area is missing from this update. Screenshots: Screen Shot 2023-08-31 at 12 06 02 PM Screen Shot 2023-08-31 at 12 14 07 PM

ndittren avatar Aug 31 '23 16:08 ndittren

Oh weird, I thought the shadow was visible on my system. We definitely want to keep that - I will investigate.

nikolas avatar Aug 31 '23 16:08 nikolas

So, my scene with these changes looks pretty different from yours - I've tested in Firefox and Chrome:

Screenshot_2023-08-31_13-54-26

Another problem with your scene is overall lighting issue, which should have been addressed by these changes.

It could be a video card issue, with this webGL stuff. I am on a much older system, so it's possible it's behaving differently. But, are you sure you're running the right version of the code here? This PR includes the updated, compiled bundle.js and you shouldn't have to do any special build process here.

nikolas avatar Aug 31 '23 17:08 nikolas

I just tried running it again, same issue. But maybe it is on my end. Do you want to push this out and see how it runs on the github page?

ndittren avatar Aug 31 '23 18:08 ndittren

That's okay, there's no rush for these changes to go out. I'll see if I can reproduce this issue on other systems, like at home, or on a mac.

nikolas avatar Aug 31 '23 18:08 nikolas

@ndittren I have rebased this branch and done another build on the current version of threejs this simulation is using (0.155.0). There were lighting changes in threejs before this that necessitate some of the changes in the code here - and things are looking on my system:

Screenshot_2024-07-09_10-57-03

I'm curious how they look on your Mac on this branch.

nikolas avatar Jul 09 '24 14:07 nikolas

@nikolas pretty much the same. There is this slight hiccup with the stick figure in the second screenshot

Screenshot 2024-07-09 at 1 41 58 PM

Screenshot 2024-07-09 at 1 42 56 PM

I think the original issue was the missing shading around the globe. But it looks fine without it really.

ndittren avatar Jul 09 '24 17:07 ndittren

Cool! Yeah there is some weirdness with that shadow that has been introduced through three.js updates - it is also supposed to be in the shape of the stick figure instead of a block, but that's a minor thing. I think we can move forward with these changes and i can finally make an updated build for this sim as it looks like the last one was done in 2021.

nikolas avatar Jul 09 '24 17:07 nikolas