Quads DX
by Badguy · in Technical Issues · 04/03/2004 (11:30 am) · 9 replies
GRRR....
well .. at the beginning of porting my engine from GL to DX
and low and behold I cannot find native support for quads.
so now Im going to either :
A:) drop support for quads
B:) force my dx system to utilize extra indices into the vertices.
what the hell man.. this is crap.
It might not seem like much but its a pain in the ass.
dx sucks.
if someone could come in here and say "negative meathead, the support is there your just to blind to find it"
and then show me the way that would be great.
well .. at the beginning of porting my engine from GL to DX
and low and behold I cannot find native support for quads.
so now Im going to either :
A:) drop support for quads
B:) force my dx system to utilize extra indices into the vertices.
what the hell man.. this is crap.
It might not seem like much but its a pain in the ass.
dx sucks.
if someone could come in here and say "negative meathead, the support is there your just to blind to find it"
and then show me the way that would be great.
About the author
#2
what im needing now is single shot quads :)
for the basic components.
and yes indeed OpenGL handles it all internally for me.
it's really a matter of convenience, im just sniveling I guess.
I've already begun to simply create thier index buffer for Every object now. :(
I was hoping to just take the simple ones and push em out.
Snipped from d3d9types.h :
I will go check right now for the high order primitives you speak of.
04/03/2004 (12:04 pm)
Well indeed for the large model's.what im needing now is single shot quads :)
for the basic components.
and yes indeed OpenGL handles it all internally for me.
it's really a matter of convenience, im just sniveling I guess.
I've already begun to simply create thier index buffer for Every object now. :(
I was hoping to just take the simple ones and push em out.
Snipped from d3d9types.h :
// Primitives supported by draw-primitive API
typedef enum _D3DPRIMITIVETYPE {
D3DPT_POINTLIST = 1,
D3DPT_LINELIST = 2,
D3DPT_LINESTRIP = 3,
D3DPT_TRIANGLELIST = 4,
D3DPT_TRIANGLESTRIP = 5,
D3DPT_TRIANGLEFAN = 6,
D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
} D3DPRIMITIVETYPE;I will go check right now for the high order primitives you speak of.
#3
Note that using GL_QUADS is the same as using GL_TRIANGLES and sending two triangles.
04/03/2004 (12:07 pm)
Simplistic Example :// Turn on Quad drawing... glBegin(GL_QUADS); // Plot some points... glVertex3f(0,0,0); glVertex3f(0,1,0); glVertex3f(1,1,0); glVertex3f(1,0,0); // And end glEnd();
Note that using GL_QUADS is the same as using GL_TRIANGLES and sending two triangles.
#4
:)
this is a conversation about porting that logic to directx.
which you will want to use an Index to do. at the very minimum.
Edit:
Mark:
the D3DRECTPATCH_INFO seem's like a fairly complex method to use to handle a simple single quad.
that is the structure for the high order primitive.
I will use an index it is easier.
if we were talking about a multi quad piece.
then I would consider that instead.
04/03/2004 (12:32 pm)
Heh james..:)
this is a conversation about porting that logic to directx.
which you will want to use an Index to do. at the very minimum.
Edit:
Mark:
the D3DRECTPATCH_INFO seem's like a fairly complex method to use to handle a simple single quad.
that is the structure for the high order primitive.
I will use an index it is easier.
if we were talking about a multi quad piece.
then I would consider that instead.
#5
Not even a useful mention in the DX docs, or google. And all the MS examples that have 'screen quads' use a tri-strip.
Doesn't mean i'm right though :p
04/03/2004 (12:54 pm)
Unless i've completly missed it in all my work with DX it doesn't support quads natively. I just use an indices buffer and create the two triangles on the four verts. Pita, but seems to work fine.Not even a useful mention in the DX docs, or google. And all the MS examples that have 'screen quads' use a tri-strip.
Doesn't mean i'm right though :p
#6
and yea it seems to work fine.
it wont be a problem as the real art content is already triangles forced.
pain in the butt cause now I have to make a special index when I initialize my dx scene. gl handled it for me.
by allowing the user to define a quad list and an index to it.
gl would do the triangle dance.
now that index has to be massaged by me no biggy.
04/03/2004 (1:25 pm)
Indeed Gareth I have surmised the same result's myself.and yea it seems to work fine.
it wont be a problem as the real art content is already triangles forced.
pain in the butt cause now I have to make a special index when I initialize my dx scene. gl handled it for me.
by allowing the user to define a quad list and an index to it.
gl would do the triangle dance.
now that index has to be massaged by me no biggy.
#7
04/05/2004 (5:06 am)
In GL quads are transformed into triangles by the drivers. Using quads in GL is generally bad policy b/c then you are completely dependent on the driver which may or may not be efficient at doing this. It isn't nearly the issue these days as it used to be but we *are* starting to get a new round of hardware and drivers so it is something to consider.
#8
Not going/wanna to start a flame war here. I'm just curious.
04/05/2004 (6:32 am)
Just a question: why porting the engine to directx?Not going/wanna to start a flame war here. I'm just curious.
#9
If he's anything like me, it's because he got tired of messing around with different rendering paths and GL extensions for various hardware from different vendors in order to support the latest techniques, and was pleasantly surprised when things he tried in DX Just Worked(tm)
Or just for education's sake =)
04/05/2004 (7:35 am)
Quote:Just a question: why porting the engine to directx?
If he's anything like me, it's because he got tired of messing around with different rendering paths and GL extensions for various hardware from different vendors in order to support the latest techniques, and was pleasantly surprised when things he tried in DX Just Worked(tm)
Or just for education's sake =)
Torque Owner Mz
As long as we're talking about them, Hardware support for quads isn't exactly a high priority. I'm fairly sure even openGL drivers are handling as pairs of triangles under the hood. You might be better off converting to triangle strips if you can - that should save the driver some extra work on the CPU.