OpenGL or D3D?

Started by
3 comments, last by Goodlife 24 years, 3 months ago
All right, dudes, I''ve posted a question here a couple times, and nobody in the D3D camp seems to know the answer. I turn to the OpenGL''ers... In my program, I want to have vertices that have the same xyz coordinate, but different uv coordinates (for textures). In Direct3D, every vertex gets one texture coordinate, so if I have two vertices on top of eachother, but with different tex coords, they have to get transformed twice. Have you ever heard of anything slower? So, my question is, does OpenGL allow you to either attach multiple texture coords to a vertex, or, better yet (this is what I did in my software engine) assign the texture coords when you place the triangle? I might switch over to OpenGL if I have to. Probably should have started there in the first place, since D3D took me six weeks to get proficient in. Thanks in advance! --Goodlife
-- Goodlife-----------------------------Those whom the gods would destroy, they first drive mad.--DirectX design team official motto
Advertisement
Yes, OpenGL can do that, if I''m not mistaken. In fact, OpenGL can do 99.9% of what Direct3D can, except for a few little obscure things.

Yes, you should have started with OpenGL. =) You should switch anyway. =)
The answer to your question depends on how you are drawing your triangles. If you are using vertex arrays you can''t have multiple verts with the same texture coordinate. I have tried to find a way around this but it turned out that it was easier to just duplicate the vertex and assign it the second texture coordinate. If you are drawing using normal glBegin/glEnd then you can have a vert with multiple texture coords since you can specify the texture coordinate as you draw. Using glBegin/glEnd is not the fastest approach to things though. the best way to go. Hope this helps.




Nate
http://nate.scuzzy.net
in D3D, you can make your own vertex format and have multiple texture coordinates per vertex.
Carl "trixter"[email=carl@trixoft.com]carl@trixoft.com[/email]http://www.trixoft.com
Yeah, for D3D you should look up Flexible Vertex Format in the SDK Help. It describes all you need to know about it. You definately want to define your own vertex format since D3D''s won''t fit most peoples needs.

--TheGoop

This topic is closed to new replies.

Advertisement