PDA

View Full Version : Poly Size?



LostInTheWoods
09-23-2002, 11:13 AM
Quick question, on todays hardware what is a good unit size to work with? To be more specific, (working on game design 3D first person), when building my walls, and floors, I was thinking of using 2ft X 2ft, tiles (2 triangles). Is this a good idea? I mean, in most instances that will work, but on door ways and such i have to go 1ft x 1ft, or maybe even less. I have set it up to use 3inches = 1. This way i can use 3in, 6in, 9in, and ANY whole foot dimentions, without having to use floats, (ints MUCH faster). But more to the point if i have a room 40 feet long, 40 feet wide, and 10 feet high. That is around 1200 triangles, not including doors and such for one room. Is that TOO many>?

Korval
09-23-2002, 11:45 AM
You should subdivide walls/floor/etc only if you need to (vertex lighting, etc). Otherwise, why bother? If you don't need vertices in the middle of a wall, why put them there?

LostInTheWoods
09-23-2002, 11:53 AM
2 words, Texture Mapping. Imagine a map with 12 different rooms, and 12 different wall papers in the rooms, Imagine how LARGE of a texture map you would need if you didnt tile your walls, and floors. That is why you need verts in the middle of walls, and lots of them.

EDIT:

Ofcourse you could just make some REALY cheezy texture maps, but im going for a mix of quality and speed.

[This message has been edited by LostInTheWoods (edited 09-23-2002).]

davepermen
09-23-2002, 12:17 PM
small brick texture. wallpapers ontop of them as simple quads.. or more detailed if you want to..

V-man
09-23-2002, 12:29 PM
Originally posted by LostInTheWoods:
2 words, Texture Mapping. Imagine a map with 12 different rooms, and 12 different wall papers in the rooms, Imagine how LARGE of a texture map you would need if you didnt tile your walls, and floors. That is why you need verts in the middle of walls, and lots of them.

EDIT:

Ofcourse you could just make some REALY cheezy texture maps, but im going for a mix of quality and speed.

[This message has been edited by LostInTheWoods (edited 09-23-2002).]

Not that large! I dont think there's need to go over 1024 x 1024 , even for a large terrain. If there is, it is better to break quads up to avoid seeing float precision effects (polygon shaking)

If you need to go even beyond that, most hardware support 2048x2048, but that's insanely large for a typical room.

V-man

Lars
09-23-2002, 12:48 PM
You know that you can supply texture coordiantes larger then one resulting in repeated or mirrored textures. Depends on the mode (just dont use clamping).

This way you can have tiles, without tiling the polygons.

And for the integers vs floats, this isn't worth it anymore, cause floatingpoint units are extremly fast and parallelized (SSE Extensions) and the TnL Units on GPUs also use floats (now even the Fragment units). So no big win there.

Lars

LostInTheWoods
09-23-2002, 03:41 PM
Lars. Ok, a question. Your telling me if i have a quad. Like 0,0 20,0 20,20 0,20. And i simply use texture coors like 0,0 20,0 20,20 0,20, it will produce 20 copies of the texture across the one poly? If so, this would be AMAZING. Well exept the fact for light maps might be tricky. But is that what your saying, that you can produce Multiple copies of the same texture over one poly? Secondly, floats are actualy as fast as Ints? Then why does quake 3 engine use ints for all its maps instead of floats?? I thought ints were always faster? Thanks for the help.

LostInTheWoods
09-23-2002, 04:33 PM
OH CRAP, I was just taking a look at the Q3 Radient map maker. Are you meaning to tell me that an entire wall in the map is 2 polys. I mean an entire 40 unit long wall is only 2 POLYS with the texture map reapeated along it? Ok, but this causes a major question. If someone did this, HOW would you create an array for the triangle data, considering each wall would require a different texture? You would have to draw each wall seperatly, that would take alot of time wouldnt it? Or am i correct with my first thought process? That you must tile your polys to create the use of one texture and ONE pile of verts in an array??

Korval
09-23-2002, 05:11 PM
Your telling me if i have a quad. Like 0,0 20,0 20,20 0,20. And i simply use texture coors like 0,0 20,0 20,20 0,20, it will produce 20 copies of the texture across the one poly? If so, this would be AMAZING.

Welcome to the world of GL_REPEAT.


Well exept the fact for light maps might be tricky.

That's why we use a separate set of texture coordinates for them.


You would have to draw each wall seperatly, that would take alot of time wouldnt it?

There really aren't that many walls to draw. Besides, not every wall uses a different texture.

LostInTheWoods
09-24-2002, 04:02 AM
Ok let me get this strait. On todays hardware, (extenuous as it is), it is faster to draw 15 walls, one at a time in there own mini vertex array, each with a different texture, and set of texture coords, then it would be to draw an entire room, in ONE chunk using one texture. HOW BORING, i mean what if you want to change textures mid wall, you would have to create 2 sub walls, and drawn them independently too.

I think on todays hardware, that is able to kick out over 30 million triangles a second, you could do a little more. Take for instance, if your rendering at 60fps, that is roughly 500,000 triangles possible per frame. Then take into account a 50% discrepency, (do to lighting, textures, etc; AKA all the stuff they DONT check for when they make those tests for MAX polys per second), so where down to 250,000 polys per frame. Now say each room in your map has a max of 2,000 polys. And you have 5 maps showing, thats only 10,000 polys, what about NPC, take another 2000 per character, and if you have 10 of those on screen, thats only 20,000, for a total of 30,000 all togeather. Well maybe more, (multipasses, etc) BUT on cards that can kick out 30 million polys, they support atleast 3 or 4 texture units, why would you need more than 4 passes?

In conclusion, you are only using a fraction of the true power of those cards with the "common" method. Tell me im wrong, and I will change my current setup, but I dont think I am.

ToolChest
09-24-2002, 05:14 AM
Good luck getting 30m tris in a real world scenario. Youíll see that number rapidly fall away when you start running into issues with fill rate and when your cpu is to bogged down to push enough data to your video card.

LostInTheWoods
09-24-2002, 05:23 AM
I understand that 30 million is unrealistic. BUT, what is a realistic number? I mean, quake3 has a per vertex lighting check box. Meaning it must have actual verts on the wall to do this. I mean, if you are using characters that have 1500 polys (which is the average for a nice figure in most games). And your maps only use 1000-2000 per room, (basicaly on the same poly terms as on NPC) then rendering 5 rooms, would be simply like rendering 5 NPC. Now your telling me in games, there is never 5 NPC in a room at once. Hell, in Quake 3, i have had over 20 players in one room, fog, items, map, and everything running at once. I personaly think that 1000-2000 per room acceptable. Expecialy if they are all being drawn in ONE chunk with an indexed vertex array. Also, they only use ONE texture, making the need for excess calls unnessesarry.

Ok, let me ask you this, in an "average" room in quake 3, or alice, or castle wolfenstine (all running the same engine) how many polys are there?

ToolChest
09-24-2002, 07:32 AM
I was under the impression that q3 characters were around 800 polys. I seem to remember that from an article I read on importing your own from max. I downloaded a q3 bsp to max converter and the maximum poly count in any of the levels was around 100k.

As for polys per second, it depends on what you are willing to develop. On a gf2 if you are willing to use nvidia specific exts you can maybe get 20m max (before fill rate issues). If you are writing generic code around 6m. Be careful these numbers assume you arenít sending much more than the vertex coords. As for realistic numbers, that will depend on your hidden surface removal, your math libs, your character interaction,Ö.. and list goes on and on. The trick is balancing all of the work your gpu and cpu are doing. Keep in mind that most things you add to your engine will slowly bring down your 30m goal.

John.

ToolChest
09-24-2002, 07:41 AM
btw: when I say '20m (before fill rate issues)', I mean that if you have no fillrate issues you could get 20m, not that greater than 20m creates issues. http://www.opengl.org/discussion_boards/ubb/smile.gif