|
-
Sep 22nd, 2002, 05:30 PM
#1
Thread Starter
Lively Member
DX8 : General Tips
Hi all
Im just about to em,bark upon a project but b4 I start I was wondering if any1 could help me with a bit of advice:
1) I assume hex colours are faster than using RGB(x,x,x) / D3DColorArgb(x,x,x,x). What tool can u use for calculating hex colour codes please?
2) I realise to reduce overdraw it is best to draw the screen from back to front. Any tips on implementing this?
3) I can calculate normals and use them when I use trianglelists but would have problems when using trianglestrips and index buffers. Any help on this 1 please?
Thanks in advance
Dan
-
Sep 22nd, 2002, 05:31 PM
#2
Thread Starter
Lively Member
Sorry I meant front to back
-
Sep 22nd, 2002, 05:32 PM
#3
Thread Starter
Lively Member
PS If two quads (I think this is the word for a flat square made up of 2 traingles) face the same direction will the vectors in quad1 have the same values as the vectors in quad2?
Thanks
-
Sep 22nd, 2002, 06:14 PM
#4
Frenzied Member
1) If you are a performance nut, they are faster, but if you are using VB, you arent a performance nut. Dont worry about it =).
2)ZBuffering takes care of overdraw. When rendering alphablended particles, and you turn z writing off, over draw DOES become a problem. What you can do is transform all of the particle center points with the world and view matrices, and then sort by z coordinate.
3) When one vertex is shared between several faces, its normal is the normalized average of all of its shared faces.
4) Do you mean Normals? It depends. See 3.
Z.
-
Sep 22nd, 2002, 07:13 PM
#5
Thread Starter
Lively Member
Z
Yeah I do mean normals for 4.
Do u use normals and index buffers together Z? If so have u got some code for how u do this please. Otherwise I have to scrap using either triangle strips or lighting and I would like to use both.
About 2 (but less important), I read that DX doesnt render stuff behind other stuff. However if u render the stuff at the back first it renders it and then also renders the front stuff whereas if u do the front stuff first it renders that then doesnt render the back stuff because it knows it is behind something.
How do u go about rendering the stuff closest first?
I was thinking of dividing the level into regions and rendering those regions closest to the cam first since they would be at the front.
Like I say tho the normal thing is more important to me.
Thanks
Dan
-
Sep 22nd, 2002, 07:33 PM
#6
Frenzied Member
I use indexed triangle lists for my models, and use normals. Do you know how to find the normal for a triangle? If so, it is just a simple matter to find a vertex normal. Simply find the face normals of all triangles that share that vertex, and average them. Set the vertex's normal to what you end up with.
A ZBuffer will take care of overdraw. It will save you on drawing, but not transformation. If you want to save on transformation time, you need to look into some sort of culling algorithm. The only time you need to worry about overdraw is when you DONT use the ZBuffer.
Z.
-
Sep 22nd, 2002, 11:11 PM
#7
Thread Starter
Lively Member
Thanks Z u saved the day again 
Thats five pints I O U now right?
Dan
-
Sep 22nd, 2002, 11:12 PM
#8
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|