Sign in to follow this  
DragonGeo2

[Fixed] [D3D9] Quad won't render

Recommended Posts

I need some ideas as to why my quad won't render. I checked it out in PIX and for all I know, it *should* be drawing but it's not.

PIX verified for me that the post-transformed vertices (I'm using the fixed function pipe for now) show up in the middle of the viewport, right where they should be.
The culling mode is currently set to D3DCULL_NONE.
A texture is set (R8G8B8A8 texture with all opaque alpha) and alpha blending is disabled.
Fillmode is solid.
The write mask is RED | BLUE | GREEN | ALPHA.
Lighting, fogging are disabled.
ZENABLE is false.

Vertex decl is:
[code]static const D3DVERTEXELEMENT9 _terrain_2D[] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
{0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
D3DDECL_END()
};[/code]

Both D3DTS_VIEW and D3DTS_PROJECTION matrices are set to the identity matrix (because I am drawing 2D objects on the screen).

I am using this code to perform my quad drawing:
[code]DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP, 0, 0, 4, 0, 2);[/code]

The vertices are (positions first, then texcoords):
0: (0.0f, 0.0f, 1.0f) (0.0f, 0.0f)
1: (1.0f, 0.0f, 1.0f) (1.0f, 0.0f)
2: (0.0f, 1.0f, 1.0f) (0.0f, 1.0f)
3: (1.0f, 1.0f, 1.0f) (1.0f, 1.0f)

And my index buffer is:
0, 1, 2, 3

So does anyone have any ideas that I could check out as to why I'm not seeing anything on the screen?

Edit: Well this is the third time this week that I've managed to rubberducky myself on GameDev. The problem was that I had clipping planes enabled which quickly became invalid after I changed my projection matrix to the identity. I disabled them and that fixed it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this