Skip to main content
29 votes
Accepted

How do game engines avoid recalculating normals upon mesh rotation?

They don't. When you rotate a mesh, the normals in memory are not changed in any way. All that changes is the object's transformation matrix is updated. The raw mesh vertex and normal data remains ...
DMGregory's user avatar
  • 135k
16 votes

How do game engines avoid recalculating normals upon mesh rotation?

DMGregory's answer explains how this is actually handled, but I'd like to point out a couple of misconceptions: Assume that a face of a mesh is defined by vertices ...
Kevin Reid's user avatar
  • 5,508
10 votes
Accepted

Performance of manipulating a mesh in realtime

Yes, you can change a mesh at runtime. get the current mesh from your object using Mesh mesh = GetComponent<MeshFilter>().mesh. Alternatively, if you want to ...
Philipp's user avatar
  • 120k
7 votes
Accepted

How to create Half hemisphere 3D model

If you just need it once, I'd suggest you pick up some basic knowledge of a modelling tool. It's very easy to do in Blender: Delete the cube that you start with by pressing ...
1000ml's user avatar
  • 293
7 votes

Applying a face image to a mesh head

I am one of the developers of the itSeez3D application you linked in your post. Accidentally stumbled upon your question. @Kevin van der Velden provided an entirely relevant reference here, I would ...
Aleksei Petrenko's user avatar
7 votes
Accepted

How do I generate a sphere mesh in Unity?

So, I've already done some research on this and I've found an Icosphere generation code on Unity Wiki and it's not terribly hard to find, but still I wanted to share what I have on the matter, since ...
John Hamilton's user avatar
7 votes

Texturing different block types on an optimized voxel mesh

Nice idea by the author. From experience... High vertex counts aren't that much of a problem (100Ks, millions even). Dealing with complex UV mapping is far more so. Sometimes it is worth staying ...
Engineer's user avatar
  • 30k
6 votes

How to merge two objects in Blender

If the result in the image satisfies you, here's how I achieved it. Subsurfed the initial cube once Created a second cube and scaled it Added a boolean modifier to ...
qwazix's user avatar
  • 161
6 votes
Accepted

How to make low poly ground look better

A texture is a simple idea. You say you've tried some and they didn't look good. If you created the texture out of polygons would it look better? Or better yet, maybe try making the ground a flat ...
user1118321's user avatar
  • 2,632
6 votes
Accepted

Texturing different block types on an optimized voxel mesh

Quoting the meshing page you link: It isn’t too difficult to modify the code deal with either multiple block types or different normal directions. What you would do is modify the array called “mask” ...
DMGregory's user avatar
  • 135k
6 votes
Accepted

What is the purpose of tangent and bitangent vertex attributes?

Tangent and bitangent vectors are used for tangent space normal mapping / lighting and certain forms of displacement mapping. In a tangent space normal map, we store the per-pixel normal in the ...
DMGregory's user avatar
  • 135k
6 votes

Should I model with quads or with n-gons?

It doesn't really matter. 3d models with faces that have more than 3 vertices don't really exist in 3d graphics*. They are a usability-convention of the modeling program. 3d rendering engines can only ...
Philipp's user avatar
  • 120k
5 votes
Accepted

How do you compute the tangent space vectors with normals given in the mesh?

Summarizing the clarifications above as an answer: There are multiple ways to generate tangent spaces for a mesh, and not all of them agree on the result. This is a common source of rendering errors ...
DMGregory's user avatar
  • 135k
5 votes
Accepted

How can I convert my list of vertices and indices to a list of triangles?

Typically, your list of indices looks like this: ...
DMGregory's user avatar
  • 135k
5 votes
Accepted

How to UV map a procedural cylinder mesh? (Unity)

It looks like you're trying to use (rotated) vertex positions as UV coordinates. When you're using this to look up into a 2D texture, only the x & y values are used and the z is ignored, giving ...
DMGregory's user avatar
  • 135k
5 votes

How does 3D mesh morphing work?

In the Sims 4, you can drag to reshape the face when you create a sim. How is the geometry morphing implemented? Only guys with access to the code can tell you that. In general, how do you code a ...
wychmaster's user avatar
5 votes
Accepted

How does LOD (Level of Detail) work in Unity?

Unity doesn't generate FBX files. The Unity Editor lets you import FBX files, which Unity converts into its own propriety file formats when you build your game. Each LOD is a separate mesh and will ...
Kevin's user avatar
  • 6,234
4 votes

Performance of manipulating a mesh in realtime

As Philipp said, you can change the mesh at runtime. You might have performance issues though (it's not "streaming" at all); in particular RecalculateNormals will ...
Calvin1602's user avatar
4 votes

How does 3D mesh morphing work?

We do not know the details of how they did it… However, there is a modding community for The Sims and they manage. The idea is as follows: There is one base model for body type. There are series of ...
Theraot's user avatar
  • 27.2k
4 votes
Accepted

Can I convert a Unity file with the extension ".asset" to ".prefab"?

You do not "convert" an asset to a prefab. These are different things that serve different purposes. A prefab is a game object that can exist in your scene. An asset is the raw data that a ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

How to calculate verticle normals of triangular mesh

It looks like some normals are pointing the wrong way. This means that those triangles aren't wound correctly. As a quick fix you can do: ...
ratchet freak's user avatar
3 votes
Accepted

Multiple UV coordinates in Unreal Engine Procedural Mesh Component?

The only possibilty you have is to add the vertex twice, if no collision is generated, this will have almost no performance impact, if you do want collision, subclass the UProceduralmeshComponent ...
Maxim DC's user avatar
  • 139
3 votes

Should the level design be in Unity scenes (GameObjects) or in 3D programs (mesh)

This is very project dependent. Every studio, group, and developer has a preferred method. Generally, you use meshes when it's easier to construct something in your 3D editor rather than the scene ...
Zebraman's user avatar
  • 819
3 votes

How to have multiple GameObjects sharing pieces of same material?

Have you looked into using Unity's Shadergraph to make your own shader for the material? You might be able to achieve what you want by using the worldspace position for texture/uvs. I am not good at ...
faulknerj's user avatar
3 votes
Accepted

Architecture for defining large numbers of meshes at runtime

You may want to take a look at Graphics.DrawMesh. It lets you draw individual meshes without individual GameObjects.
Ed Marty's user avatar
  • 5,229
3 votes

How to make procedurally generated terrain look realistic

First of all, note that Unity already has a very nice terrain system out-of-the-box. It gives you a lot of nice features for free like LOD, occlusion culling and a lot more. Also, it can look pretty ...
Philipp's user avatar
  • 120k
3 votes
Accepted

How to know if two surface are in the same direction?

Imagine applying a force along those normals to the faces. If the normals both face in the same direction (e.g. outward), then it would have a book closing effect, the faces would get closer. If they ...
Bálint's user avatar
  • 14.9k
3 votes
Accepted

Mesh made in Blender is correct in Unity3D as a rendered mesh, but "empty" as a collider?

this is just a guess that I am pulling out. but I see a missing line on the side of your stairs. No line showing up in unity seems like a hint. you can see triangles 012, 234, and 145 because of the ...
Jody Sowald's user avatar
3 votes
Accepted

How to cut a desired shape out of a mesh?

I have done this for automated medical CAD procedures as well as game engines, and will attempt to provide adequate information in order for you to accomplish this task on your own, but I will not be ...
Jon's user avatar
  • 534
3 votes

How to cut a 3D mesh like a lathe?

I implemented the effect by doing a virtual lathe. I used Unity for simplicity, but this can be done in pretty much anything. First I had to generate a cylinder: Instead of simply doing a normal ...
Bálint's user avatar
  • 14.9k

Only top scored, non community-wiki answers of a minimum length are eligible