zIndex ordering for shaders with instanced geometry #10559
Unanswered
shirecoding
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a scenario where i used instanced geometry with a shader to draw lots of grass.
However my player is a sprite (not using shader). As you can see there are some grass instances which should be in front of the player depending on the y coordinate. I did try scaling and setting the 3rd dimension z of
gl_Position
from between [-1, 1] but to no avail, are sprites zIndex not the same as the vertexes z coordinate?I am considering drawing the player texture using a fragment shader and setting the z position there. However I am not sure if this will work too. Or does the renderer not take into account the z coordinate but only use draw order? The problem then is that i cannot draw the instanced geometry till the player then stop and draw the player then continue drawing the rest.
Any ideas on how this should be tackled?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions