Jump to content

Pros and Cons or Best Practice


Recommended Posts

A simple theoretical question I was thinking about earlier.

Here are three models that are visually identical, though geometrically different.

Mtja9dP.png?1

Yellow: Two meshes, one pass through the geometry of the other. 24 Tris.

Green: Single mesh, inset and extruded. 44 Tris.

Blue: Three meshes, aligned face to face. 32 Tris.

When rendered (AO shader), they are visually identical.

IpdyTjH.png?1

The question: As far as KSP is concerned, are there any pros or cons to any of these practices or generally speaking, is one practice better than the other two? Or... is there even a difference at all?

Link to comment
Share on other sites

negligible difference.

if you really wanna count nanoseconds, the left is the most efficient, least vertices; but some times you can get a zigzag effect where the faces intersect.

middle is the least likely to have any render anomalies. the right one is probably identical to the middle as far as the GPU is concerned.

Edited by nli2work
Link to comment
Share on other sites

Rendering with AO is irrelevant. Baking AO is not. If you bake AO on all of these you will get slightly different results, which get exaggerated if the pixel density is low. The best way is to have one mesh all connected. It's called a "manifold". Manifold meshes (the green one) leave no AO baking artefacts where the other meshes would have some black bleedthrough where the meshes meet or intersect.

Obviously you can be smart about it and figure out where it's important to keep polycounts low, but afaik triangles are much much cheaper than textures, so most of the time you won't need to worry about triangles.

Link to comment
Share on other sites

You can attach seperate objects into one mesh tho and it acts as a single draw call even tho it contains disconnected sub meshes.

Whats the better choice depends on the situation, on your cubic example it will add very little triangles to connect it to one mesh and wont make a visual difference, but if, for example, you wanna add a 12 segment cylinder onto a higher poly sphere, connecting the objects would require much more additional polygons, and more importantly, would totaly ruin your poly flow and mesh smoothing, so for such an example you should keep the meshes disconnected and slightly clip the cylinder into the sphere.

Link to comment
Share on other sites

if you download the 30day trial of unity pro, you can use profiler to see what kind of GPU and CPU costs each setup incurs. should be very good guideline for KSP at least.. I generally go with the middle whenever possible, and left when necessary, since KSP only accepts 1 shader per object.

Link to comment
Share on other sites

Also you need to think about Z fighting, that's when one mesh gets drawn on top of another and flickers. The middle mesh will not have the problem and the others will if you start to pull the camera away. Also the middle one will waste the least amount of UV space giving you a higher texture density and better mapping.

Triangles are extremely cheep to render, and the least performance impacting thing you really need to worry about. So model in what ever way gives you the best visual results and is easy to work with.

As Nathan has pointed out Draw Calls are what you should be worrying about.

Multiple materials on a single mesh also produce extra draw calls.

Link to comment
Share on other sites

Excellent, thank you all. As many of you observed, I wasn't referring to these models, but general best practices and pros and cons of each. Might be no real difference in models like this, but when you're pushing thousands of triangles...

So from your comments, it would appear that the middle object (green) would be the best practice. It has the highest triangle count, but as you pointed out, triangles are cheap. It would also maximize UV space and require the fewest draw calls. Is that an accurate assessment?

Mtja9dP.png?1

Edited by noonespecial
Link to comment
Share on other sites

Excellent, thank you all. As many of you observed, I wasn't referring to these models, but general best practices and pros and cons of each. Might be no real difference in models like this, but when you're pushing thousands of triangles...

So from your comments, it would appear that the middle object (green) would be the best practice. It has the highest triangle count, but as you pointed out, triangles are cheap. It would also maximize UV space and require the fewest draw calls. Is that an accurate assessment?

http://i.imgur.com/Mtja9dP.png?1

drawcalls are made irrelevant as long as you join the objects into 1(can still be many seperate meshes).

but more efficient uv space is a really big advantage.

joined geometry takes more time and sometimes you need to seperate those edges anyway(the edgesplit modifier in blender works by doing this, also unwrapping more complex geometry objects often requires seperating the islands anyway)

my advice for lowpoly modelling is to use a combination of the middle and the right pictured technique(but for the last one remove any faces that are hidden and extend the edge a bit into the geometry. this is mostly good when "joining" mostly planar objects together, like adding some protruding portholes to a cylinder or a cube). it also allows for easier modifications since you wont need to worry about the attached geometry.

the leftmost technique creates too much wasted uv space so i would stay away from it.

for the middle technique try to avoid using boolean operations for joining(if you do use them, make sure you clean up the geometry afterwards or you will likely run into artifacts and difficult unwraps) its usually better to model the extrusions/cavities with the help of shrinkwrap modifiers + vertex slide etc..

if you are baking ao directly from your lowpoly models it is also preferred to model in all medium to larger details.

uv space effectivity is most important(if it is a big detail, it is almost always better to model it in)

hope this helps

Edited by landeTLS
Link to comment
Share on other sites

So from your comments, it would appear that the middle object (green) would be the best practice. It has the highest triangle count, but as you pointed out, triangles are cheap. It would also maximize UV space and require the fewest draw calls. Is that an accurate assessment?

http://i.imgur.com/Mtja9dP.png?1

Yes that's the basics. # of shaders; size of the textures; smoothing groups; UV layouts; all affect the rendering costs per frame, strictly speaking. biggest bottle neck is texture size and # of textures. geometry is practically free. I subdivided those different setups to 9~12k triangles each, and they sit around 0.2ms per frame, no different than if they are 12~48 triangles

Link to comment
Share on other sites

I believe some maniac did a geometry test to see how much was too much. I can't find the thread now, but KSP ate a lot of polys (it was either 90,000 or 900,000 IIRC) before things got slow. I tend to aim for the middle setup as much as I can too, btw.

An enlightening discussion, guys - thanks :)

Link to comment
Share on other sites

If I need to extrude a cube out of a quad surface, or a 32 cylinder out of a 32 vetices circle then i'd use the second method.

For 32 cylinder out of a quad... i'd use the third method and extend the edge a bit inside the geometry as its more time saving than complex connexions.

Imo work time is one of the most costly element in modeling, so keep it simple ;)

Also, if you use smooth shading, second method can sometime generate weird shaped shadow unless you planned to use edge split modifier.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...