# 2.5D compute depth

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

## 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 on other sites
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 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 on other sites
I heard about depth sprites, but I don't know the specifics.

##### 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?

1. 1
2. 2
Rutin
13
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633261
• Total Posts
3011127
• ### Who's Online (See full list)

There are no registered users currently online

×