28 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
  • 134k
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,498
10 votes
Accepted

Why do Physics Engines use collision margins?

There are three reasons collision margins may exist in physics simulations. As you suggested, a collision margin gives the physics engine some room for error in detecting contacts and resolving ...
Steven's user avatar
  • 3,062
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
  • 119k
8 votes
Accepted

How check if an arbitrary given mesh is a single closed mesh?

Alternatively - to provide an easier-to-implement and more efficient solution - one can check the mesh's Euler-Poincaré characteristic. Given the number of vertices V, number of faces F and number of ...
Tobias Gurdan's user avatar
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
Accepted

Calculated normals for mesh not working

vec3 norm = vec3(uViewMatrix * uModelMatrix * aNormal); The normal cannot be transformed like a point, to transform a normal you use the inverse transpose matrix. If you want the fun details of why ...
Tim's user avatar
  • 601
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
  • 29.5k
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
  • 134k
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
  • 119k
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
  • 134k
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
  • 134k
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
  • 134k
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

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
  • 134k
4 votes
Accepted

How to make (or where to get) a half-sphere mesh that textures properly?

You shouldn't really worry about cutting of the other half of the sphere since Unity doesn't render faces that are looking away anyway. That doesn't solve your problem however. Try to save your sphere ...
Školstvo's user avatar
  • 336
4 votes
Accepted

What technique should I use to implement the following type of "diggable" terrain?

Data / Model vs. View / Rendering First let's clear up one thing: data model vs. view, in the sense described by MVC. One moment you're talking about one: How can I implement such a modifiable ...
Engineer's user avatar
  • 29.5k
4 votes
Accepted

Procedural rock algorithm

One approach could be to start with a sphere, perhaps pick some random parameters to stretch it varying amounts so some rocks are roughly round, while others are roughly egg shaped, then use 3D perlin ...
jackmott's user avatar
  • 188
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
  • 26.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
  • 134k
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

If a 3d surface is occluded by another 3d surface, does this have any effect on the performance and rendering speed?

It depends. There is performance difference depending on fill-rate limitations, order in which polygons are drawn and early Z-test. If, for example, your engine renderer is fill-rate limited and you ...
Kromster's user avatar
  • 10.6k
3 votes

Procedural rock algorithm

When I create rocks in modelling softwares, I start from an icosaeder, fhen stretch it around, scale it a nit, then I just pick random vertices and I pull them a bit out. I suppose, the same can be ...
Bálint's user avatar
  • 14.9k
3 votes
Accepted

If a 3d surface is occluded by another 3d surface, does this have any effect on the performance and rendering speed?

My answer, much like Krom's, is that it depends. In cases where you have large swaths of polygons being obstructed by another object, it's likely going to be a good idea to cull objects that are ...
JonBee's user avatar
  • 659

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