SFML community forums
General => Feature requests => Topic started by: Kalero on April 19, 2008, 02:22:47 pm
-
Hello,
can you integrate in sf::Sprite a Methode for the Z order, please?
It would be very nice ^_^
-
What would be the point of adding such things into SFML ? Just do it on your side ;)
-
If I doing it by Software, I think it's many work and not good for Performance.
Or can I use only the Depth Buffer from OpenGL and do all other by SFML?
-
You don't need a Z-buffer to do this, just sort your sprites by depth so that they are rendered in the right order.
-
I mean this. But I mean, that I dont want sort the Sprites by Software.
I think its easyer, if SFML use intern Depth test, and you can sort the Sprites by a Z Coord.
I hope, you understand, what i mean. my English is terrible ^_^'
-
Sorting one array of pointers won't hurt your performances, if it's what you're afraid of... ;)
-
okay, then I do it so.
But I think its a very usefull think ^_^
-
But I think its a very usefull think ^_^
No not really. Sorry.
-
Just have an integer to sort which order to draw them in then sort them all? That is what I would do... Adding a Z element would add not necessary complexity to a Simple & Fast Library.
-
Adding a Z element would add not necessary complexity to a Simple & Fast Library.
Sorry, but this is not right. Its much easyer, because you must give the sprites only a Z coord and you can draw the Sprites in order how you want....The Graphic Card draw it ever with the right Z-order.
And that is much easyer, as to write a function, what must sort the Sprites, in the right order. :wink:
-
Adding a Z element would add not necessary complexity to a Simple & Fast Library.
Sorry, but this is not right. Its much easyer, because you must give the sprites only a Z coord and you can draw the Sprites in order how you want....The Graphic Card draw it ever with the right Z-order.
And that is much easyer, as to write a function, what must sort the Sprites, in the right order. :wink:
Only if your order will be never changing ;-)
And if it not changing...so iit is easy to work without z-order:
Draw the 'behindest' sprite first...then the next and at least the sprite which is the nearest to you ;-)
-
Only if your order will be never changing ;-)
And if it not changing...so iit is easy to work without z-order:
Draw the 'behindest' sprite first...then the next and at least the sprite which is the nearest to you ;-)
I think you have don't complett understand what I have write
If the the order never changing, you don't need everything for the Z-order :wink:
-
besides there ist a problem with every transparent Sprite.. (zBuffer is either set to the sprites Z, or not) So a half transparent sprite would blow up the entire system..
-
If the the order never changing, you don't need everything for the Z-order :wink:
I think you knows what I mean. Thats all.
-
besides there ist a problem with every transparent Sprite.. (zBuffer is either set to the sprites Z, or not) So a half transparent sprite would blow up the entire system..
that is right, but if you disable the Depth Buffer for this time it should be work.
-
but then again Z sorting via Z position won't work ;)
Than your exacly at the current position -> you have to render em in the right order^^
-
but then again Z sorting via Z position won't work ;)
Than your exacly at the current position -> you have to render em in the right order^^
Sorry, I don't understand what you mean.
For some times I have do it like this in OpenGL, and it all works fine.
-
If you turn of Zbuffering, you will have to render em in the proper back to front order. (start drawing the lowest one, and going on with the higher ones..) otherwise the one last drawn would appear to be the highest one.