-----------
Update:
I seem to have found some more information about my problem.
I made a video to summarize my issues: three render order issue - YouTube
Basically, depending on the order at which I load in my instances, it will cause either the red or the blue slices to render correctly. If I load all of the blue instances on the screen, set the opacity to zero, then do the same with the red, the blue will work while the red will not (vice versa).
-----------
Original Post:
Hello,
I am working on a three JS animation where multiple instances will be changing opacity as the render in to create slicing affect.
I created a video to showcase this: Rendering Issue 1 - YouTube
In this video, you can see how I have two separate animations going on: one to slice in the red boxes and one to slice in the blue. Each of these animations are composed of multiple instance meshes, one for each slice, that have different opacity timings. This creates a interlocking animation between the two colors with no overlaps.
Each work on their own, but when I attempt to combine both together, I end up getting a issue with the opacity not working.
If I attempt to make the blue slices transparent with zero opacity: rendering issue 2 - YouTube
Now they just turn up black and are not.
Each slice has the following material:
In this case, the opacity is zero (useCustom is true), and later animates to one.
new three.MeshPhongMaterial({
transparent: true,
receiveShadow: true,
opacity: useCustom ? this._threeModelAnimationOptions.animationMesh.custom[groupItem].opacity : this._threeModelOptions[groupItem].opacity,
color: new three.Color(useCustom ? this._threeModelAnimationOptions.animationMesh.custom[groupItem].color : this._threeModelOptions[groupItem].color)
})
Material property of the instance mesh. Each slice is added to the scene and has the opacity set to zero. When it animates it, it is set to one.
Line 103 starts the settings. min and max opacity is what it starts at to the opacity it animates to.