1 (edited by aurelwu 2025-03-15 20:29:11)

Topic: how to keep 2D Marker Order stable when using multiple textures?

Hi,
when using just 1 marker texture this problem does not occur and I followed the example here https://infinity-code.com/atlas/online- … ample.html

However when assigning multiple different textures to markers then sometimes at change of zoom level or when moving around suddenly all markers of one texture are drawn in front of another even if they previously where behind. I attached a screenshot to show that.

Is there something what I can change to make sure this does not happen? I also tried a custom comparer which uses a fixed assigned z-value to all markers and looking at what happens with the debugger attached this comparer also is definitely used - however the behaviour is still the same.

Post's attachments

Attachment icon Z_Fight1.png 1.7 mb, 102 downloads since 2025-03-15 

Re: how to keep 2D Marker Order stable when using multiple textures?

Hi.

Thank you very much for the bug report.
I will definitely fix it, but I don't know how long it will take because the problem is quite deep.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by aurelwu 2025-03-16 14:11:06)

Re: how to keep 2D Marker Order stable when using multiple textures?

Thank you for the quick reply.
Do you have any ideas for workarounds in the meantime? I guess using a single texture which acts as texture atlas might work?
PS: really like the package so far, bought it a long time ago but only recently found a usecase for it and aside from that minor annoyance it is working great and intuitive to use and extend.

Re: how to keep 2D Marker Order stable when using multiple textures?

A workaround is to use 3D markers that will look like 2D markers + a custom shader that will sort the markers on the Z axis of the scene or the Y axis of the screen.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: how to keep 2D Marker Order stable when using multiple textures?

I have written a new marker drawer for you (attached) that will fix the problem.
Just add this component to the map.

Post's attachments

Attachment icon SeparateFlatMarkerDrawer.cs 7.1 kb, 130 downloads since 2025-03-21 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: how to keep 2D Marker Order stable when using multiple textures?

First of all sorry for the late reply, and thank you for your swift response and the script.
I found a solution now - your script sadly had a few issues* but helped me understand how to solve it. *markers rendered in front of UI and also markers now showing up at bottom part of map sometimes but that might also be issues arising from the logic of my side.
Anyways for now I am going the 3D-Markers route and added a "index" field to each marker which is assigned once when markers are created which I use to set the y-coordinate, this way I can have the behaviour I want which is that most recent markers are rendered on top of older ones, which not only results in stable order but results in a map where the visuals match closer to the data distribution than rendering all the different marker colors in a specific order which results in a dominance of the last drawn color.