Jump to content

Objects touching each other with faces. Do they intersect? Does this affect FPS?


Recommended Posts

Blender or Wings 3d.

Say, we have a model consisting of two same cubes, standing one on another.

Obviously, their vertices have same coordinates, but probably differing by some microscopic random values.
Thus, we probably actually have at least two randomly intersecting squares.

As the graphics engine should calculate visibility/invisibilty, orientation and so, it will probably split the intersecting squares in a set of regions, and instead of 2x4 vertices we now get several tens of them, and more faces to calculate.

***

Unity/KSP.

Say, we have two parts each consisting of a simple cube.

They have attach nodes laying on the face centers.

When we attach one part to another, we get similar situation with two faces having same coordinates, and probably randomly intersecting each other due to the rounding error.

Also, as the rounding random error is random, the parts may (and sometimes do) flicker at their contact place, when you rotate the assembly a little.

***

Questions:

1.
Is it normal to have the geometric figures in Blender/Wings3d attached to each other, or should we intentionally leave a thin gap between them?
If the gap is needed, are there any "standard" ways to make it invisible if look from aside?

2.
The same about the attach node positions. Should they have an offset from the visible face, and what about a thin gap between parts in this case?

***

Thank you in advance!

Link to comment
Share on other sites

First a disclaimer - I've made KSP parts but they're only so-so -

Blender: If I have two meshes that intersect I remove any hidden faces - probably makes very little difference but it's one less face that needs to be checked each frame. If I have a face that's partially hidden I trim the tris that are completely hidden if it doesn't mess up the shading of connected faces.

Unity/KSP: I found, particularly with fuel tanks, that two parts that are suppose to be flush with each other will cause flickering where they meet. What I do for the fuel tanks is I make the rim where they meet bulge out a small bit  beyond the connection plane (and collider) and have the attach node at the plane. This way any microscopic gap doesn't go very deep (hits the bulge from one of the two parts) and this prevents the flickering.

If you're using Blender you can download a .mu tool that can import .mu files (you need an older version of Blender - I know 2.79 works). With this you can import models from the pro's and examine how they do things.

 

Edited by wasml
missing words
Link to comment
Share on other sites

20 hours ago, kerbiloid said:

1.
Is it normal to have the geometric figures in Blender/Wings3d attached to each other, or should we intentionally leave a thin gap between them?
If the gap is needed, are there any "standard" ways to make it invisible if look from aside?

It is normal to be attached, there is no need to leave a gap. Vertices that aren't joined together have a gap but it is so small that it is invisible to the naked eye. Surface flickering of faces only happens if you have made several faces intersecting over each other inbetween the same vertices and then the render engine keeps changing what it considers to be on top.

20 hours ago, kerbiloid said:

The same about the attach node positions. Should they have an offset from the visible face, and what about a thin gap between parts in this case?

There is no need to offset, infact it is more likely to be obvious if you do offset. It is personal preference on your part but if you make it so that there is a visible gap then it will seem wrong if the parts that you have joined together by node, that should look as if they are one piece, have a noticeable gap. If in doubt put the node slightly inside the face rather than outside.

20 hours ago, kerbiloid said:

As the graphics engine should calculate visibility/invisibilty, orientation and so, it will probably split the intersecting squares in a set of regions, and instead of 2x4 vertices we now get several tens of them, and more faces to calculate.

Unity only considers 1 side of a face to be visible, this is determined when you build the model and thankfully there are 2 tools in blender you can use to be sure which way around they are (Face orientation). Now if you solidify the faces  with a gap of only 0.0001 you will get the faces intersecting, but as the faces are in opposite directions, only the ones facing out will show in game. If you don't check orientation before saving a model and have one the wrong way around then in game it will be invisible on the outside, but visible if you look from within.

FPS is affected by the number of 3d objects at one time the unity engine has to calculate, not so much the number of faces. I have a very intricate wheel tyre that I had to cut up into about 10 pieces so that each chunk was less than 10,000 vertices (because unity stores info about the model chunks in extra vertices it adds, which multiplies the vertices around 6 times, and the limit per chunk that unity can render is roughly 65,500 so 6 times 10,000) and it still renders fine with no obvious flicker or overlap.

Hope this helps.

Edited by ColdJ
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...