I have a problem in which the models I draw keep hiding other models, not in a 3d way but in a sprite kind of way.
Its weird and annoying, is there a way to fix it?
models hiding other models
Started by vrdlfe, Oct 19 2011 05:19 AM
3 replies to this topic
Sponsor:
#2 Crossbones+ - Reputation: 5185
Posted 20 October 2011 - 04:30 AM
A description of the problem or an image would help.
Guessing blindly, I would suggest enabling alpha testing and/or depth testing.
L. Spiro
Guessing blindly, I would suggest enabling alpha testing and/or depth testing.
L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#3 Members - Reputation: 187
Posted 05 April 2012 - 06:46 PM
Ye, it is probably a depth buffer problem. If you do not enable the depth buffer, things will get drawn in the order which they were added to Components, and NOT on their order in 3d space.
Set
GraphicsDevice.DepthStencilState = DepthStencilState.Default; at the start of your draw method.
Set
GraphicsDevice.DepthStencilState = DepthStencilState.Default; at the start of your draw method.
#4 Members - Reputation: 127
Posted 30 April 2012 - 06:52 PM
If it's a depth issue, you may want to look into:
- Painter's Algorithm: Sort from back to front, draw in that order.
- Depth Buffering: Discard pixels that would be behind what's already drawn.
If you want to know how to implement occlusion culling:
- Occlusion Queries (Z-Buffer hierarchy is a good optimization)
- Precomputed PVS and portals
- Painter's Algorithm: Sort from back to front, draw in that order.
- Depth Buffering: Discard pixels that would be behind what's already drawn.
If you want to know how to implement occlusion culling:
- Occlusion Queries (Z-Buffer hierarchy is a good optimization)
- Precomputed PVS and portals






