   Depth sorting using transformed vertices
  Heya all,I am trying to create a GUI using transformed vertices and d3d9. It all coming along nicely...except for z-ordering.Does direct3d allow for ordering transformed vertices, and between what ranges?I seen anything less than 0.0f isn't shown and anything greater than 1.0f is behind 3D geometry.I have tried creating 3 controls in my gui. Z values are 0.001f, 0.002f and 0.003f. However it doesn't affect the ordering, they still stay in the same order when rendering.I am batching vertices, but I doubt this would have an effect, would it?Thanks!   
  Provided you have a depth buffer enabled and active then it should work fine. I've used this sort of trick on a number of occasions [smile]Maybe trying different depth values might work better - it's possible that the resolution of your depth buffer might not be seperating them enough. Something like 0.0, 0.1, 0.2, 0.3...1.0.Although, if you're trying to mix this with a 3D scene and you don't actually want the 3D scene to appear between/through the GUI, you might just be best off disabling Z-test and Z-write and just batching by Z-Order.The GUI that I have for one of my projects has a built in Z-Order per control - it's not that difficult to do. It can make for very small batches, but I haven't found that to be a problem unless I've got a ridiculously cluttered GUI...hthJack   ;Damn, stupid me. It wasn't D3D, it was my depth sorter. It seems it isn't sorting components correctly and was always setting 0.0f for the Z regardless of what was 'activated'.Can anyone give me a clue on how to do depth sorting for my GUI ?