• Advertisement
Sign in to follow this  

2.5D compute depth

This topic is 2303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, i develop a game in 2.5D.
For the depth computation i use a math algorithm with plane and raycast. But this algorithm use lot of processor when there is lot of entities...


So i wonder if it's not possible using billboarding to draw my sprite and benefit of 3D depth?

My question is how to reprensent a sprite in vertices, (usually for billboarding it's 6 vertices) i need more vertices to represent depth.

I am a beginner in 3D rendering technique, so tell me if it's possible?
And if it's possible some tips to get it.


Thank you.

Share this post


Link to post
Share on other sites
Advertisement
It's possible, but that depends what you want to do. If you mean placing your billboards in 3D space and using the z-buffer to sort it out, yes, it can work.

Also, you only need 4 vertices for your billboard. One at each corner on a plane. You then map the UV coordinates at the correct coordinates on your texture containing the sprite.

Share this post


Link to post
Share on other sites
But it's not possible to add a Depth for sprite for exemple my sprite is 100Width100Height and add 100Depth on z axes?

Because billboarding with 4 vertices won't give depth to my sprite.

Thank you.

Share this post


Link to post
Share on other sites
If I'm understanding "depth sprites" correctly, it's basically just a voxel height layer to the sprite, where you do per-pixel depth reads and writes, instead of interpolating depth across the triangle/quad face.

I've usually only seen it used to give proper volumetric effects to particle effects like dust clouds and smoke, where you use the depth from the sprite "front" to the nearest opaque geometry as an extra parameter in the alpha component. However, if what saturn1 is trying to do is get a plain sprite to still have a 3D appearance in combination with depth-supporting monitors, the voxel technique is sufficient to trick the 3D card into the correct use of the depth buffer.

saturn1; what "depth computation" are you doing that takes up CPU time, and what "benefit of 3D depth" are you hoping to get?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement