Z-Buffering implementation

General discussions regarding Nimrod.

Z-Buffering implementation

Postby olwarpaint » 02 Jul 2010, 15:54

Hi.

Firstly, let me say that I didn't see a general dev forum discussion in your board index so I chose this one as the most relevant. I have been reading your posts on GDN for a while now. I am trying to implement a better sorting solution for an isometric engine built in actionscript 3. Seeing all the great work you have done with your Space 3000 demo videos and other work in isometric gaming, I would like to reach out to you.

Here is what I have thus far
Image

I am so far having a hell of a time getting my head around the concept in the way it applies to isometry. My basic plan of attack is this:
  • parse the screen space into a 2D grid of cells, each cell a specific size (treating each cell as a pixel? analogous to a pixel in trad. z-buffering)
  • determine which of those cells an isometric object occupies (be it fully or partially)
  • now here is where I get lost
  • slice the isometric object's display data into individual cell slices
  • somehow assign a depth to that slice and assign it to a 2D grid of the cells
  • based on the depth (not sure how to determine the depth, I know it can't be calculated from the origin of the iso object) determine relative to other existing slices, if this slice is ordered correctly
  • iterate thru the array of slices and place those slices correctly onto the screen

SO i have to ask, am I anywhere close to implementing a z-buffer for isometric views? Is this the approach you took? Or can you shed some light on how better to do this? I really REALLY appreciate all you have done on the GDN forums and what you are doing here. Thanks

Ol War Paint.
Last edited by admin on 02 Jul 2010, 16:59, edited 1 time in total.
Reason: fixed image
olwarpaint
 
Posts: 2
Joined: 02 Jul 2010, 15:39

Re: Z-Buffering implementation

Postby olwarpaint » 02 Jul 2010, 15:56

I just noticed the link to the image isn't showing. you can view it here http://screencast.com/t/YTdkNTZlOGQ
olwarpaint
 
Posts: 2
Joined: 02 Jul 2010, 15:39

Re: Z-Buffering implementation

Postby O-san » 02 Jul 2010, 17:24

olwarpaint wrote:Hi.
SO i have to ask, am I anywhere close to implementing a z-buffer for isometric views? Is this the approach you took? Or can you shed some light on how better to do this? I really REALLY appreciate all you have done on the GDN forums and what you are doing here. Thanks

Ol War Paint.


Hello!

That is a very interesting approach, sort of a low resolution software z-buffer. I think it should work, although there might be some blocky artifacts due to the resolution. It is not the method I am using but the concept seem to be the same as a hardware z-buffer although in a much lower resolution.

If you want this to work I think you have to assign some sort of depth values to your isometric objects slices and add them when composing them to the screen slices. Also when adding the depth values for each slice to the screen you would need to take into account the objects position.. like screenSlizeZ[x][y]=objectPositionZ+thisObjectSliceZ. When adding the object to the screen you need to check if the combined new Z value stands out more than the screenSlizeZ value, if it doesn't disregard it. Did that make any sense?

However, I think you would be better of using a hardware Z-buffer or some sort of "filmation" technique (Knights of Lore, Alien8 games). Filmation does not allow correct sorting of objects in all situations, but it is probably the best approach when no z-buffer is available.

Does action script provide a z-buffer?

I am going to create an iso-programming forum, thanks for the insight =)
User avatar
O-san
 
Posts: 5
Joined: 12 Nov 2009, 14:03

Re: Z-Buffering implementation

Postby O-san » 02 Jul 2010, 17:45

If you decide not to go with hw or sw z-buffer I found a two links on sorting:
Topological sorting
Filmation math
User avatar
O-san
 
Posts: 5
Joined: 12 Nov 2009, 14:03


Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron