You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 3 sprite3d with different Z value. The middle one (sp2) is slanted.
camera
sp1 \ sp2
------ \ sp3
\ ------
\
I want to see that sp2 covered sp1, and sp3 covered sp2.
But, because the Z value of sprites is order as sp3 > sp2 > sp1. I always see that sp1 covered sp2, and sp2 covered sp3.
Is there any way to fix the overlay order?
=====
I want to see it like this:
But it's like this:
The text was updated successfully, but these errors were encountered:
There's a way but it requires algorithm that i .. just dont have in this repo. Google "scanline", if you are not afraid :)
Its shame that i lost my implementation and didnt put it here :(
I found that can enable the webgl auto hidden surface removal alghritm by set AbstractBatchRenderer#state.depthTest to true, and set AbstractBatchRenderer#state.blend to false.
And then, write z value in vert prog like "gl_Position.z = - 1. / gl_Position.w + 2.;".
The cover ordering is working right now.
(All these mod in Sprite2dRenderer.ts)
But, when enable the webgl depth test, all the alpha channels are going to be a mess.
There are 3 sprite3d with different Z value. The middle one (sp2) is slanted.
I want to see that sp2 covered sp1, and sp3 covered sp2.
But, because the Z value of sprites is order as sp3 > sp2 > sp1. I always see that sp1 covered sp2, and sp2 covered sp3.
Is there any way to fix the overlay order?
=====
I want to see it like this:
But it's like this:
The text was updated successfully, but these errors were encountered: