unit – How to make a user interface on a mesh without distortion or loss of quality?

I create a text adventure game in Unity 2018.2. My plan is that the interface looks like an open book with the user interface displayed on the page, curved with the mesh. After some research, I decided to use a rendering texture for that.

My problem, however, is that the rendering texture is of very poor quality. See the image below – the top line represents the canvas with text, set on Screen Space Camera, as it appears in the world. This camera defines the rendering texture, which is applied to an empty plane mesh (the bottom line). In other words, the top line corresponds to the original and the last to the rendering texture. The bottom line is crushed and distorted, which (if I understand correctly) also leads to the white outline when it samples from the bottom 0 alpha camera.

What I have already tried:

  • change the size of the rendering texture in 1920 * 1080 or 2048 * 2048
  • change the looping mode of the rendering texture, which has no effect
  • changing various settings in the canvas, camera, and texture
  • resizing the plane (enlarges the text but does not make it grow and remains deformed)

Some additional details: the text is made with Text Mesh Pro. The aircraft shader is set to UI / Default, otherwise the background of the camera was also rendered and covered everything behind it.

So, what is the solution to this? Can I apply the render texture to a mesh without it being stretched or distorted? Or is there another way to achieve what I'm looking for?

enter the description of the image here

Unreal Engine 4, import landscape mesh

I can export the landscape of UE4 (File -> Export selection -> .obj / .fbx) and load a landscape, for example, in Maya. But how is the modified landscape reloaded in UE4? If not, how to import land in UE4? Thank.

P.S .: All formats and all publishers are interested.

Can all tools merge an object mesh with repeated textures?

I have a mesh obj with some textures, many of them are repeated (uv's are not [0,1]). I would like to merge all these textures into one texture and transform the UV.

As I know so far, some algorithms 1) transform uv when the texture merges. 2) divide triangles into small triangles to keep each uv in the interior [0,1]. 3) The RTT method can help solve this problem.

Are there tools that can implement it?

On the formal definition of mesh or region for a planar graph

A graphical representation of a planar graph divides the plane into the regions or mesh (as they are called in some applications, for example in circuit theory).

Yes, the above is intuitive, but what I did not find in the classic textbooks on graph theory is a formal definition of the mesh related to the definition of the graph as a pair of sets of vertices and edges. In particular, is there a formal definition of the mesh (or region) of a graph that does not rely on its graphical representation or that relies on a formalization of it?

unit – Get the project plan of Click mesh and calculate its area

Here is the excerpt from my script that calculates the area and facial area of a mesh on OnMouseDown Event.

                private void OnMouseDown ()
Mesh selectedMesh = this.gameObject.GetComponent().mesh;

float surfaceArea = CalculateSurfaceArea (selectedMesh);
float areaFromXFace = CalculateFacingArea (selectedMesh, new Vector3 (1, 0, 0));
float areaFromYFace = CalculateFacingArea (selectedMesh, new Vector3 (0, 1, 0));
float areaFromZFace = CalculateFacingArea (selectedMesh, new Vector3 (0, 0, 1));
float areaFromClickedFace = ProjectionPlaneClickedArea (selectedMesh);

string area = " n Surface:" + surfaceArea;
areas + = " n Area of ​​the X-axis face:" + areaFromXFace;
areas + = " n Area of ​​the Y-axis face:" + areaFromYFace;
areas + = " n Zone of the Z-axis face:" + areaFromZFace;
areas + = " n Area of ​​the selected face:" + areaFromClickedFace;
Debug.Log ("Zones:" + zones);


float ProjectionPlaneClickedArea (Mesh selcectedMesh)

Camera c = Camera.main;
Ray ray = c.ScreenPointToRay (Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast (ray, out hit, 100f))
Debug.DrawRay (ray.origin, ray.direction * 100, Color.yellow);
Debug.Log ("normal:" + hit.normal);
Debug.Log ("Normal / Direction Zone:" + CalculateFacingArea (selcectedMesh, hit.normal));
return CalculateFacingArea (selcectedMesh, hit.normal);
return 0f;

float CalculateSurfaceArea (mesh)
// Limitation: note that if your mesh has double-sided faces or internal faces, they can skew this result.
var triangles = mesh.triangles;
var vertices = mesh.vertices;

double sum = 0.0;

for (int i = 0; i <triangles.Length; i + = 3) // iterates on the triangles of the mesh
Vector3 corner = vertices[triangles[i]]; // for each triangle, we calculate vectors representing both edges
Vector3 a = highs[triangles[i + 1]]- corner;
Vector3 b = highs[triangles[i + 2]]- corner;

sum + = Vector3.Cross (a, b) .magnitude; // half of the crossed product of these edges gives us the area of ​​the triangle

return (float) (sum / 2.0);

     /// only calculates the mesh surface in a particular direction, you can try this version instead.
/// Specify the direction in which you want to display the mesh. The projected area must then be calculated.
/// the faces turned at least partially in this direction.
      float CalculateFacingArea (mesh, Vector3 direction)
direction = direction.normalized;
var triangles = mesh.triangles;
var vertices = mesh.vertices;

double sum = 0.0;

for (int i = 0; i < triangles.Length; i += 3)    //iterate over the triangles of the mesh
             //"Subtracting each 2nd & 3rd vertex" just gives the two edges of the triangle radiating from the initial corner. 
             Vector3 corner  = vertices[triangles[i]];
             Vector3 a       = vertices[triangles[i + 1]] - corner; 
             Vector3 b       = vertices[triangles[i + 2]] - corner;

            //The cross product divided by two gives the area of the triangle.
            //The dot product is what handles projecting this area onto the plane of interest. 
            float projection = Vector3.Dot(Vector3.Cross(b, a), direction);

            if (projection > 0f) // add only the projected triangles
sum + = projection;
return (float) (sum / 2.0);

I am able to calculate the surface of the face by CalculateFacingArea method, it takes a mesh and the direction that works well, as if I want to calculate the area of ​​x direction, I can use it

float areaFromXFace = CalculateFacingArea (selectedMesh, new Vector3 (1, 0, 0));

BUT I need to provide the face / direction information dynamically, what I do in this function ProjectionPlaneClickedArea using a raycast. It's about getting normal at the points of attraction that I use as the direction and passing them to the function. It works well with some of the meshes but not with all the meshes, for example below the image:

enter the description of the image here

As you can see, if I click on this object from the front, then it is necessary to calculate the surface of the Y side but it calculates with the X direction. The normal value of the click point is (1.0, 0.0, 0.1).

Although it works correctly if the axes of my clicked object look like this:

enter the description of the image here

In this case, x is facing and working properly. I have this value of normal (1.0, 0.0, 0.0).

I am neither an expert in geometry / mathematics nor a modeller, so I can not identify the normal problem of its object or its computation problem.

Remember that I do not want to model all objects in the same direction / axis, where I can get the hard-coded direction. I want to calculate the direction dynamically but correctly.

unit – Algorithmically split a mesh in Unity3D?

I want to create a plugin that splinters / fractures of the meshes, so that I can do each object destructible If I want. As in Unreal built-in functionality.

My quick approach to this problem is generate random cuts:

  • each cup divides the mesh in 2 groups: left side of the cup and right side of the cup,

  • at points where he intersects the mesh, I add vertices to both groups.

  • and add 1-1 face to each group with these new highs.

  • create the new mesh.

Is there a better way? What do you recommend? Is my path even possible? If so, which API methods should I use?