Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Z order  (Read 29439 times)

0 Members and 1 Guest are viewing this topic.

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« 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 ^_^

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Z order
« Reply #1 on: April 19, 2008, 05:18:14 pm »
What would be the point of adding such things into SFML ? Just do it on your side ;)
Laurent Gomila - SFML developer

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #2 on: April 19, 2008, 05:33:31 pm »
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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Z order
« Reply #3 on: April 19, 2008, 06:02:44 pm »
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.
Laurent Gomila - SFML developer

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #4 on: April 19, 2008, 06:14:39 pm »
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 ^_^'

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Z order
« Reply #5 on: April 19, 2008, 06:21:01 pm »
Sorting one array of pointers won't hurt your performances, if it's what you're afraid of... ;)
Laurent Gomila - SFML developer

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #6 on: April 19, 2008, 06:22:32 pm »
okay, then I do it so.
But I think its a very usefull think ^_^

aisman

  • Newbie
  • *
  • Posts: 25
    • View Profile
Z order
« Reply #7 on: April 19, 2008, 06:56:44 pm »
Quote from: "Kalero"
But I think its a very usefull think ^_^

No not really. Sorry.

eleinvisible

  • Newbie
  • *
  • Posts: 47
    • View Profile
Z order
« Reply #8 on: April 19, 2008, 08:46:59 pm »
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.

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #9 on: April 19, 2008, 09:34:03 pm »
Quote from: "eleinvisible"
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:

aisman

  • Newbie
  • *
  • Posts: 25
    • View Profile
Z order
« Reply #10 on: April 19, 2008, 09:54:26 pm »
Quote from: "Kalero"
Quote from: "eleinvisible"
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 ;-)

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #11 on: April 19, 2008, 10:04:39 pm »
Quote from: "aisman"
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:

tgm

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Z order
« Reply #12 on: April 19, 2008, 11:07:35 pm »
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..

aisman

  • Newbie
  • *
  • Posts: 25
    • View Profile
Z order
« Reply #13 on: April 19, 2008, 11:13:50 pm »
Quote from: "Kalero"
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.

Kalero

  • Newbie
  • *
  • Posts: 15
    • View Profile
Z order
« Reply #14 on: April 19, 2008, 11:16:44 pm »
Quote from: "tgm"
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.

 

anything