Direct3D Resources

Started by
4 comments, last by johnp 23 years, 11 months ago
As someone trying to learn Direct3D I have found it really frustrating how poor the SDK documentation is and surprised the lack of support/interest on the net. Opengl has shit loads of support and there are tons of examples/tutorials for it. Am I just not looking in the right place? Are there any good books on DirectX 7 for someone past the beginner stage? I have access to the MSDN library and there really is not that much on that or the MS web page for Direct3D. Again, the www.opengl.org page is fantastic. Any ideas why 3dfx have not created their own full blown opengl32.dll? (I have a Voodoo 3 BTW). Back to Direct3D(7)...In particular I am looking for information on the following... 1. How to use multiple texture coordinates per vertex (SetTextureStageState stuff), and is this better that duplicating vertices. 2. The best vertex format to use.
Advertisement
Hi

I think MS did a very good Job with the DirectX 7 Docs.
But that is just my Opinion, i didn't need anything else to create an DirectDraw/Direct3D/DirectSound Application.

1.
Normally it is more efficient to use multiple Textur Coordinates, cause you don't have to transform the Vertex (and Normal) a second time. And you can use them with Multitexturing.
For working with a second set of texture Coordinates, you first need to use an Vertex Type which has D3DFVF_TEX2 (Which stays for two Tex.Coords, for 3 you would use D3DFVF_TEX3 ).
That means you have an additional two floating Point Values per Vertex.

Now when rendering, you have to set IDirect3DDevice7::SetTextureStageState(stage,D3DTSS_TEXCOORDINDEX,TexCoords)

where stage is the Texturestage for which the TextureCoordinates should be used, and TexCoords is the Index of TexCoords you wish to use.

That is all you need for that.

2.
That depends on the things you wan't to render.
I always use the Flexible Vertex Format, where you decide which Parts of an Vertex you need (you can find detailed Information in the SDK about that)
In all cases you need the D3DFVF_XYZ or D3DFVF_XYZRHW Part cause this describes the Point either transformed or untransformed.
Because of Question one i think you are using textures, so you also need the D3DFVF_TEX*. With that you get an triangle on the Screen. But if you wan't to use Vertex Lighting, and wan't that DirectX computes it for you you also need an Normal Vector D3DFVF_NORMAL (only for untransformed Vertices).
If you are doing your Lighting yourself (transformed or untransformed) you need to specify the D3DFVF_DIFFUSE and eventualy D3DFVF_SPECULAR.
If you don't apply Textures, don't need the TexCoordinates, but an normal or Diffuse Value instead. Import when using the DirectX Lighting Engine is to Check if an appropriate Material is set, and if have created an Light Source.

If that didn't help you , Say a bit more precisely what you wan't to render.

Lars

Edited by - Lars W. on 5/4/00 3:53:02 AM
--------> http://www.larswolter.de <---------
Thanks for the input Lars, that helps. I still can't get my head around something, and I think this is where the SDK docs are poor. The SDK docs mention that you should not change the render state too many times during a frame, especially texture changes. Okay, makes sense. I make sure my object database has polygons sorted by texture/material and render them in groups. My question is, does it make sense to group polygons with the same number of texture coordinates within texture, and are there other groupsing or is this taking it too far?

The general problem i'm having is structuring a Direct3D program for a reasonable performance. I'm basically doing this for fun, and i'm far from an expert. I don't expect to write the next Quake engine. But I don't want to end up with something that runs at 2fps. Would I get a reasonable performance with each polygon using it's own vertex? Of course it depends on what I'm rendering. I'm looking at a creating a Direct3D general purpose C++ class library which I can use to create games. Anything from a first person shooter to a race game.

Although there is a lot of resource on game programming in general, these problems are specific to Direct3D and this is where I find the lack of resource/books that go a bit further than just explaining function by function what the API does.

Help much appreciated.





Edited by - johnp on 5/5/00 2:06:40 AM
Yes Jonp is wright.
There are nearly no good tutorials on Direct3D,
the docs are very good but there just a reference.

And there are no good books on this topic.
Each of the existing books on D3D7 isn''t worth the money to spend on - they are only copies of the SDK doc.

It seems DX gets more and more better and soon will overtake OpenGL - that breaks my heart.
Why is there nearly no information in the web to learn from,
even MS has nearly nothing on there Website -nearly no samples and technotes.

I hope that some day there''s more in the net about it or a good book which is worth the time to read.
And the problem of writing a good book is that the DX versions changes every 10 month - and there are only a few people who have the knowledge about the current version to write a book.

Or do you know some good infos or books??

M A R C N E U M A N N
{
Graphics and general programming;
Application Developer;
}
M A R C N E U M A N N{Graphics and general programming;Application Developer;}
Yes Jonp is wright.
There are nearly no good tutorials on Direct3D,
the docs are very good but there just a reference.

And there are no good books on this topic.
Each of the existing books on D3D7 isn''t worth the money to spend on - they are only copies of the SDK doc.

It seems DX gets more and more better and soon will overtake OpenGL - that breaks my heart.
Why is there nearly no information in the web to learn from,
even MS has nearly nothing on there Website -nearly no samples and technotes.

I hope that some day there''s more in the net about it or a good book which is worth the time to read.
And the problem of writing a good book is that the DX versions changes every 10 month - and there are only a few people who have the knowledge about the current version to write a book.

Or do you know some good infos or books??

M A R C N E U M A N N
{
Graphics and general programming;
Application Developer;
}
M A R C N E U M A N N{Graphics and general programming;Application Developer;}
Actually, I think that the 3 MB ocumenatation that comes with the sdk is quite good and suffifient for learning the coding part.

Using multiple texture co-ordinates is just a matter of using a vertex format that has got more than a se t of texture co-ordinates or U can get d3d to generate them for U.

The best format to use I think is the one that suits U most ... which might be the one that corresspond to the information stored in your 3D art file.

This topic is closed to new replies.

Advertisement