Author : Nate Broach


Reply
Reply
 
Thread Tools Display Modes
Ged's Avatar
Old (#51)
interesting read. Do you guys think these principles could be true for online 3D? Director with havok, flash cs3, java etc? or are those engines not powerful enough to experience benefits from good hardware? Im just thinking of all the really low poly online games out there and was wondering wether this is due to performance or bandwidth or software or just the developers?

Some of this thread has just gone over my head but Im currently working on a Director 3D game and its my first 3D game, so this is a relevent topic as theres just 2 of us making the assets.
Offline , veteran polycounter, 3,902 Posts, Join Date Feb 2007, Location UK cheltenham  
   Reply With Quote

EarthQuake's Avatar
Old (#52)
I'm going to go out on a limb and say no, definately not. Those sort of projects are designed to run in a webbrowser, on a large range of hardware and would likely not benifit from the optimizations of a current gen rendering engine.
Offline , Moderator, 8,630 Posts, Join Date Oct 2004, Location Iowa City, IA  
   Reply With Quote

CrazyButcher's Avatar
Old (#53)
Ged I think its a mix of everything that results in low-end graphics. The last time I looked at Director3D, it was like Directx7 or 8 renderer below, and it didnt use any "modern" features, read "modern" being 4 year old already... Those bigger content apps normally dont go with the modern hardware, and do a lot more cpu stuff, and hit those batching limits earlier. They are mostly meant to run on "anything" that is some integrated chip sets, with age old drivers. Though I am not sure how good flash or the others are. I know certain java libraries that make use of performance enhancing capabilities do exist, but I dont know how widespread the stuff is.
It would be good to just test the engine with dummy assets of differnt resolution, and see how it behaves on target hardware.
3dsmax scripts and .fx - pixeljetstream - expressing my own opinions
Offline , dedicated polycounter, 1,346 Posts, Join Date Nov 2004, Location Germany Send a message via ICQ to CrazyButcher  
   Reply With Quote

Mark Dygert's Avatar
Old (#54)
This reminds me of the color pallet optimization discussions. Do we use 16 shades of brown and make the most of it or do we pick stock colors and hope people like all rainbow levels. Now no one cares what pallet your textures use. We're breaking down the barriers that tie artists hands.

I think its important to keep the post as it was presented. It's not a license to waste, but approval to stop over working something to the point it hurts the end result. It's also a call to take the game as a whole into account when modeling one tiny aspect of it. I think people in general, (beginners especially) will over estimate the time that will be allowed per asset. Yes you can make a loverly dumpster out of 250tris and 2mo to work on it. Or you could make an entire alley with 25k tris and those same 2mo.

You want to be careful and not run the other way and never optimize. Being neat and tidy can be a boost to production time, especially if that asset is going to be worked on by other people. passing on something that is easy to work on can be pretty critical when the bugs start rolling in. I always hate having to go back into other peoples files, label materials and sleuth around a file for 20min before I can start fixing things. Spend 20min organizing up front to save someone else 20min of headache. Technically its a wash but people won't mind working on your files if they aren't a nightmare. At that point its not an issue of game resources but production time, which for me is king over all.

The market of games I work on is much lower then the low end mentioned in those PDF's and as such we still have to keep to the old idea of optimize until it hurts, but just a little. It will be a few years before I can toss polys to the wind and not care. I thank Microsoft for pushing quality video cards and making it a center piece of a good vista PC. It will only quicken the death of this timely tradition that keeps me from creating more.
(AKA Vig) Portfolio | Lab | Brawl | Decker |
Offline , Polycount.com Editor, 13,904 Posts, Join Date Oct 2004, Location Seattle, Wa Send a message via MSN to Mark Dygert  
   Reply With Quote

rooster's Avatar
Old (#55)
i think you made a great point in pnp vig, that polygons and draw calls aren't the only resource, time is THE resource
www.redprodukt.com
Rich Make Game! twitter: @RichMakeGame
"You can't edit nothing"
Offline , Counter of Polys™, 6,426 Posts, Join Date Dec 2004, Location Newcastle, uk  
   Reply With Quote

JKMakowka's Avatar
Old (#56)
Ok maybe a bit OT, but what about animation costs (e.g. transformation costs). More vertixes would certainly mean higher transformation costs or is that mostly limited by the number of bones (and level of weights) anyways?
And what about vertex animations (.md3) and those new Dx10 geometry shaders?

Of course given the fact that the object isn't fillrate limited anyways.

Edit: hmm to clarify: I think I read some where that DX9 and below hardware only does vertex animations and all the bones and vertex weighting is done on the CPU (and then transferred as vertex animations to the GPU), while on DX10 hardware with geometry shaders the GPU can do that. Is that right?
Offline , dedicated polycounter, 1,834 Posts, Join Date Oct 2004, Location Germany Send a message via ICQ to JKMakowka  
   Reply With Quote

perna's Avatar
Old (#57)
JM: Someone else can give you accurate data on what you want to know, but think about it in a practical way: How many of the polygons you see onscreen in your game are bone animated anyway? Like in a typical modern fps, not many. If you're gonna have a whole bunch of characters on-screen, well there's LOD for that.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,100 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

eld's Avatar
Old (#58)
Vig, while it is true that time is the most expensive thing, optimizations and such knowledge is a skill just like the art itself is,

a great artist with technical knowlege can do those optimizations quick, and if those are done for each single prop then there's something to gain from it.

The optimizations I do for work doesn't take much extra time, it's nearly always just a quick plan on how to make the object, and a thoughtprocess when in the creating.

It even helps quite alot with the artistical side too!
Offline , veteran polycounter, 4,022 Posts, Join Date Nov 2004,  
   Reply With Quote

fonfa's Avatar
Old (#59)
interesting material. but i think you guys are just getting each other wrong.

timing is part of a game artist's skill too, along with optimizing. you just gotta find the balance between it.
Offline , triangle, 396 Posts, Join Date Nov 2007, Location Montreal, Canada  
   Reply With Quote

CrazyButcher's Avatar
Old (#60)
JKM: since the first shadermodel 1 cards (geforce3...) it was possible to do skinning on the GPU. Basically with higher shader models, it became more efficient to do (can do more bones and more weights).
This in fact is done, so what you heard is wrong [img]/images/graemlins/wink.gif[/img] geometry shaders are mostly good for "generating vertices", which was not possible before. That can also be used to generate 6 copies of a mesh and render in all 6 cubemaps at once, for example. Geometry shaders can also be used to generate shadow silhouettes for stencil shadows. For those shadows it was indeed necessary to do only CPU before, simply as on the CPU was able to detect silhouette edges. hence doom3 is very stressful for the CPU as well. Most games however dont do stencil shadows, and benefit from GPU vertex processing for it. There are some workarounds that can do silhouette detection on older GPU hardware, too, but not so common I think.

for GPU skinning on sm1/2 and even most sm3 hardware, the bones are stored in "uniform/constant" memory, of a vertex shader. Typically sm1 had limits like 25 bones, and sm2 is like up to 75 bones. Then you must feed per vertex the bone index and a weight. typically that is like 2 shorts per assignment. Vertex shaders will then be written for a certain number of maximum weigts per vertex (say 2 or 3), and all vertices (regardless of their actual weights used) will be transformed the same way. Hence if you know the weights per vertex the engine allows, there is no reason at all to not use them at full extent. Typical would be 2 or 3 max weights.
the bones matrices are computed by CPU, before and sent as those "constants". The less max weights per bone = less instructions in shader + less per-vertex data to be stored. The less bones in total = less "constants" to be sent every time the model is rendered.

vertex animation aka morphing is a bit different story, and requires another per-vertex attribute stream that is either also preloaded and "fixed" (think morph targets), or dynamically changed every frame (aka md3). The latter is particularly ugly as it means sending pervertex data every frame, which is supposed to be avoided.

Skinning basically allows all mesh data to be preloaded and stored in vidmem, and only the bones' matrices must be resend. Hence its the preferred way.
However there is several higher techniques possible for animation, that store matrices in textures (sm3 vertex shaders can access textures, but kinda slow), or use renderto vertexstream, stuff and so on. However not in the common case. ut3 and crysis still use just the constants, as I would say nearly everyone else.
On consoles with dedicated vertex processing hardware (like what SSE was supposed to be for CPU), skinning might be done in software for load balancing. Like PS3's Cell has 7 streaming units, that can work with the GPU directly and "help out". Or when real complex vertex stuff is done (unlikely so), or stencil shadowing...
3dsmax scripts and .fx - pixeljetstream - expressing my own opinions
Offline , dedicated polycounter, 1,346 Posts, Join Date Nov 2004, Location Germany Send a message via ICQ to CrazyButcher  
   Reply With Quote

Sectaurs's Avatar
Old (#61)
this thread is incredibly informative.

thanks for taking the time and effort.

i'm learning!
Roböt - The Company - 3D Prototypes and Prints

Lead Artist - Stomp Games
Offline , veteran polycounter, 3,849 Posts, Join Date Oct 2004, Location Maynard, MA Send a message via AIM to Sectaurs  
   Reply With Quote

adam's Avatar
Old (#62)
Just so I may recap on a couple of points made early on:

Vert count between 2 polys, in-engine, will increase if:
-The 2 poly's share seperate smoothing group
-The 2 poly's are a part of two different UV islands

Vert count between 2 polys, in-engine, will stay 'the same' to the application's count if:
-The 2 poly's share the same smoothing group
-The 2 poly's are a part of the same UV island

Is this correct?
Offline , Administrator, 8,660 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

Rick Stirling's Avatar
Old (#63)
Adam, I believe that is is correct, and I believe you can also add in shaders/materials. If you apply a different shader to each polygon that will break it into 2 objects.
Offline , veteran polycounter, 4,217 Posts, Join Date Oct 2004, Location Edinburgh, Scotland Send a message via MSN to Rick Stirling  
   Reply With Quote

perna's Avatar
Old (#64)
AdamBrome: The best way to look at it is one vertex can only contain one data entry of each type, be it position, normal, uv coordinate or color. Whenever you need two data entries (as with a smooth group break: You'll need two normals), you need two vertices.

So, if the "same" vert has 2 positions on a UV map (such as you get when there are seams) there needs to be 2 3D verts as well.

In max, when you're in UV edit mode, you can select geometry in the 3d viewporport and the selection will be reflected in the UV viewport.
Sometimes you'll select an edge in 3d and it selects TWO in the uv viewport. You'll select a vert in 3d and it selects SEVERAL in the uv viewport. The highest count is always the real count. If if shows 4 verts selected in the uv window, then you actually have 4 verts in the 3d window as well, they're just "grouped" and handle as one.

Smoothing groups just control vertex normals. Whenever you make a hard break with different SGs you create more verts. You'll have one vert pointing one direction and the other pointing another direction. That's how you get the hard shading there.

So from this, you'll understand that things aren't split up twice. If your UV seam is in the same place as your smoothing group seams, that doesn't mean 4 times the verts.

edit: Yeah plus what Rick says. That's handled differently than the above stuff though, as material isn't a per-vertex thing, you first set material, then you push the geo data, set another material, push other data. So basically seperate material means seperate model.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,100 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

Rick Stirling's Avatar
Old (#65)
I *think* that when it comes to the shader, that breaks the polygons into a different Drawcall, instead of a batch, but I'm willing to stand corrected.

As to the smoothing groups adding extra verts, if you get your normal maps nailed you can often forego the smoothing groups and set your entire object to a single SG. Also, in the past we'd use smoothing groups on hard edges to stop the polygon shading leaking round (cuffs, jacket hems, hard edged machinery). Since adding this group adds extra verts and (will usually) break your batching, it's (usually) cheaper just to chuck in those extra polygons that a bevel will give you.

Usually cheaper, but when you are dealing with deformable objects (skin/morph), you've got more transforms to compute, so it's a toss up there.
Offline , veteran polycounter, 4,217 Posts, Join Date Oct 2004, Location Edinburgh, Scotland Send a message via MSN to Rick Stirling  
   Reply With Quote

perna's Avatar
Old (#66)
Rick: Transforms are on vertex-level
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,100 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

Eric Chadwick's Avatar
Old (#67)
Adam this picture really helped me get my head around it.



Good thread dudes.
Offline , Polycount.com Editor, 6,675 Posts, Join Date Oct 2004, Location Boston USA  
   Reply With Quote

adam's Avatar
Old (#68)
Per, Rick, and Eric.. thanks!

While I have definitions for the words in my head, can someone else state what these mean: Batch & Drawcall. I will put what I think they mean as I am sure its wrong.

"Batch"
-If a model is duplicated a number of times and its material isn't changed then they're all apart of the same 'batch' so long as they aren't grouped or defined by LOD's. Guh, that make sense? Probably not..

"Drawcall"
-Not entirely sure. I want to say that its when material layers (spec, diffuse, etc) are called to the frame buffer but I am not certain.

EDIT: Also, vertex normals. Aaargh, wtf! haha I always thought the normal of a triangle to be important and now I learn of vertex normals? Anyone have a handy picture demonstrating how a vertex's normal is defined?
Offline , Administrator, 8,660 Posts, Join Date Oct 2004, Location Toronto, Canada Send a message via AIM to adam Send a message via MSN to adam  
   Reply With Quote

Rick Stirling's Avatar
Old (#69)
Not entirely sure...but I think I'm in the right area here:

Batch: a chunk of verts that are sent from the CPU to the GPU. Batches are part of a draw call, and you can have several batches in a single drawcall. Batches are chunks of continuous verts that don't get broken by smooth groups, uv boundaries etc.
Offline , veteran polycounter, 4,217 Posts, Join Date Oct 2004, Location Edinburgh, Scotland Send a message via MSN to Rick Stirling  
   Reply With Quote

perna's Avatar
Old (#70)
AdamBrome: Strictly, there is no such thing as a polygon normal. Of course you can measure the normal of a polygon if you want, but it has no relevance in rendering. You know how on a non-flat object such as a sphere the shading goes gradually from light to dark? This shading goes from vertex to vertex, and the vertex normals determine how much influence the light should have.

It's important to realize that if light was calculated "realistically", light on an angular lowpoly object would never look smooth. Even hipoly FMV work has to use the fake gouraud style shading to get by.

There's a method to interpolate vertex normals on a curve as opposed to linearly, that is used in offline rendering and can be done in realtime shading as well.
3pointstudios.com - Game Art Outsourcing
Offline , veteran polycounter, 4,100 Posts, Join Date Oct 2004, Location UK Send a message via ICQ to perna Send a message via MSN to perna Send a message via Yahoo to perna  
   Reply With Quote

CrazyButcher's Avatar
Old (#71)
for coders mostly batch = drawcall.

drawcall:
typically consists of "world matrix", fragment & vertex shader, render states (blend,alpha-, depth-test...), textures to be used and the geometry
the geometry is a vertex buffer + indices which make the triangles (1,2,3, 2,3,4 ...), you dont need to use all vertices in the buffer, so it doesnt really matter...

it might be that the vertex data is made of different streams, that reside in different buffers as well. but lets not overcomplicate things.

the reason those non-material "splits" are nasty, is simply storage space. the more "duplicates" the larger the vertexbuffer, and the less chance of reusing the same vertex.

the vertex chunk often resides on graphics card memory (static meshes). sometimes it may be copied dynamically (lots of copies concated of the same stuff for simple instancing, or say some manual vertices say from rocket trails, particles, shadow silhouettes..). These kind of copies are not super fast, most data in games is static.

it is simply the raw data for each vertex, i.e. it is already broken down to the "unique" vertex level. several vertices of course can be indexed multiple times when they share a triangle that doesnt require splits..

batching:
being able to "render as much as possible" in a single drawcall. that means try to maximize the triangles being drawn, as every time you "start a new drawcall" its not as fast as if rendering a lot with one call/batch.

so say we have that huge vertex data chunk, already stored on vram, so we dont need to send it per frame. Then batching basically means trying to make long series of "indices" into those vertices, that we actually need now.

I can recommend reading the pdfs linked to in the very first post (the very first slide of the batchbatchbatch paper starts with "What Is a Batch?")
3dsmax scripts and .fx - pixeljetstream - expressing my own opinions
Offline , dedicated polycounter, 1,346 Posts, Join Date Nov 2004, Location Germany Send a message via ICQ to CrazyButcher  
   Reply With Quote

Ryno's Avatar
Old (#72)
Another reason to avoid extreme optimization: LODs.

So a few months back, Okkun made a good point to our team as we were making a bunch of LOD models. Some of our artists were focused on reducing poly counts to exactly the target numbers, even if it meant massacring a model. He made the point that if performance was poor, what might be the first way to improve things?

They'd bring the LODs in much closer, where those craptacular models are right in plain view.

So rather than completely destroying an LOD model to save a whopping 34 polygons, it might be better to just leave them in and maintain the proper silhouette and UV borders. Even if several dozen of these models are on screen at the same time, an extra 5000 polys means very little to a modern graphics card. But as Per was pointing out, bad looking art is bad looking art no matter how you slice it. And in the case of some of these LODs, the degradation for a very minimal polygon savings was quite extreme.
Ryan Greene
Valkyrie Entertainment
Offline , polycounter, 1,054 Posts, Join Date Oct 2004, Location Seattle  
   Reply With Quote

cardigan's Avatar
Old (#73)
I've had long long discussions with my lead engine coder about this, and he has raised something which I don't think has been mentioned here yet:

Having bevels along edges that could otherwise be hard (as in the first toolbox example on this thread), whilst not increasing the vertex count, does lead to quite a lot more small triangles on screen, especially if applied to everything in an environment.

My lead engine guy says that because gpus can fill multiple pixels in parallel, but only within the same triangle, having lots of triangles that contain very few pixels leads to stalls in filling the pixels and thereby hits your fillrate.

Example - if your triangle is 2 pixels big on screen the maximum number of pixels that can be processed simultaneously is 2, when actually the GPU could be pushing a lot more through.

As our engine was fillrate limited (I believe most are these days), he felt that this was a significant factor and therefore said that we should use hard edges where possible.

Has anyone else heard this? Any thoughts?
Offline , null, 11 Posts, Join Date Dec 2005,  
   Reply With Quote

CrazyButcher's Avatar
Old (#74)
yes thats true, but I think it was mentioned before (I put it into first post now). Thin triangles or triangles smaller than a pixel or just a few pixels will be bad for the reasons he mentioned.

That boxmesh example here, depends of course on the size of the box "on screen". Once it's just background, or always small on screen, the bevels would be overkill, and one can live with a few minor shading artefacts.
Ie its a question of LOD and "how the model is used". If you have a game with corridors and the box will always be exposed in reasonable size, there is no reason for LOD/lower res model, as the bevel tris will be okay (unless you talk about ultra fine bevels, which always would be too thin).

Last edited by CrazyButcher; 01-08-2009 at 04:24 AM..
3dsmax scripts and .fx - pixeljetstream - expressing my own opinions
Offline , dedicated polycounter, 1,346 Posts, Join Date Nov 2004, Location Germany Send a message via ICQ to CrazyButcher  
   Reply With Quote

cardigan's Avatar
Old (#75)
I've been wanting to actually do a side by side performance comparison test and see what the impact is when dealing with a whole environment, unfortunately it requires building the environment twice. If I get round to it I'll report back!
Offline , null, 11 Posts, Join Date Dec 2005,  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch