pmw, on 15 June 2014 - 03:32 PM, said:
I've made a table of sprites. I can see concrete sprite block from under the table -- not always, but from sometimes.
Same thing if I made a real red line block there, I can see it trough sprites.
Is there any way to avoid this?
make the base out of sector work (red line walls for the box). & raise it until it is the height of the table top. texture the same as the table top.
put sprites around the box, but don't allow any part of the sprites to cross the box's sector lines that you don't want to disappear.
if the player can view a sector that has a sprite partially entered into it while at the same time they can no longer see the center of said sprite, you'll get those clipping out issues.
Gambini, on 15 June 2014 - 04:30 PM, said:
Making the base out of a sector would expose similar glitches.
The order in which the sprites are drawn is directed from their "origin" distance to the player. Think of that when building your spritework. For that table I´d use more and shorter sprites for the edges and the upper part.
^-this
____________
|...................|
|........|..........|<-sprite always stays in view on this side of the sector line because
|........O.........| the center of the sprite is on this side
|
---------------|
----------<-red sector line
|...................|
|___________|<-the part of the sprite on this side will clip out of sight if player stands close to or on the sector line - the sector that's clipping though from underneath is getting drawn at a different time than the sprite that makes up the table top because of distances between the player, the center of the sprite, and the sector that makes up the table base.