I have a ThreeJS effect that was written in an earlier version and works with up to r77. I need to get this working with r110 so it works on a page with a second ThreeJS model but it’s throwing up an error:
THREE.ShaderMaterial: .shading has been removed
Here is my codepen where if you change the dependency from /77/ to /110/ you can see the issue. It still works but all color and the gold specular highlights are gone.
I recon this is the right moment to give you a very important piece of information that three.js r77 was released at the same time as Pokemon GO, Overwatch, Dark Souls 3, Titanfall 2, and Dishonored 2… it’s time to move on (r110 is still almost 5 years old already - consider jumping up to at least r150, that’s the last version between any recent truly breaking changes.)
(As to the precise answer to your question -
shading property was likely removed in-between these versions. So the simplest solution would just to remove it from your code as well )
Here is a fiddle with your code with no deprecation warnings using
The reason for the missing color was how
shininess were set before. With
r110, the uniforms require a direct update in the material now.
I fully agree with you. I did try going straight to r158 with my other more complicated ThreeJS model but I’m still in the early stages of learning ThreeJS and WebGL in general and really struggled to get it working correctly so I reverted to the newest version that didn’t break my animation which was r110. If you want to help me get both simulations working with r158 that would be greatly appreciated so moving forward I can stick with the latest and greatest ThreeJS.
Thank you Mugen, I really appreciate your help.
Next step will be trying to get both this and my other simulation working with 158.
This will require much more refactoring since the entire BAS classes have to use ES6 class syntax.