Texture zorder

Started by
1 comment, last by unicorn11 17 years, 2 months ago
Hi All, I am using a sprite to draw 2 textures on the screen one above another. the bottom texture gets drawn first and then the above one. Is there a property / method I can set or call by which i can specify which texture is supposed to get drawn above which like a zorder? so that which ever is drawn first the order of the textures always remain the same. regards Abhishek
Advertisement
This is where the Z buffer comes in handy [smile]

I've not tried it, but you might be able to use ID3DXSprite::SetTransform() to modify the Z value (1.0 for furthest away and 0.0 for closest), but failing that you might have to ditch the sprite interface.

D3DX's implementation isn't too hard to copy - just look into pre-transformed vertex data. This is either defined using D3DFVF_XYZRHW or the POSITIONT semantic and basically says that you skip the vertex shader stage of the pipeline. A bit of googling should pull up plenty of examples.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

thanks for it sorted out

This topic is closed to new replies.

Advertisement