Why does material on imported Runtime Mesh Component look bad?

it’s hard to tell but it looks like the normals are inverted on the runtime created mesh. i’ve never used that system so i don’t know why that would be. i also see an error about texture streaming pool. the issue with the textures could be because they haven’t loaded yet but, again, i’ve never used that feature.

Thanks a lot, this helped!

Nevertheless there is another issue now:
My 3D object seems to have 2 uv channels, as you can see in the editor.

By now I’m just using the fist uv channel. The texture on my object looks well but not perfect. On the top it seems to be a bit skewed.

192625-object.jpg

I thought the reason could be that I did not take the second uv channel into account. The problem is that when I try to do that by using the codeaiVector3D uvcoord = aiMesh->mTextureCoords[1][i];, my unreal engine crashes. What could be the reason for that?

To get the first uv channel I used exactly the same code except for using a 0 instead of the 1 inside the brackets.

Thx in advance

unless you changed something, the 2nd channel is the lightmap channel that UE4 created on import; you probably don’t want to use it. the material it self is super blurry, almost like it’s using a low quality mipmap. i’m also not sure it’s using the UVs shown above but it’s hard to tell. are you supplying the correct UV tiling to the model?

Fine, but what can be the reason for some textures looking skeewed?

I have some more examples:

I imported a vase. Here the texture seems to be absolutely at the wrong place. For comparison I uploaded a foto of how the vase should look like.

192864-vase.jpg

However, with another object the algorithm seems to work fine. Is it possible that some objects have wrong uv maps and it’s not the fault of the algorithm? The objects were downloaded from the internet.

192866-zahn.jpg

This is my code by the way:

for (unsigned int i = 0; i < aiMesh->mNumVertices; ++i) {
			// create temporary vertex, then pass coordinates in vector array
			aiVector3D uvcoord = aiMesh->mTextureCoords[0][i];
			aiVector2D uvmapping;

			uvmapping.x = uvcoord.x;
			uvmapping.y = uvcoord.y;

			// add vertices to the vertíces list, subtract the lowest y value so the model is on the floor --> lowest y value needs to be zero
			uvcoordinates.Add(FVector2D(uvmapping.x, uvmapping.y));
		}

		UE_LOG(LogTemp, Log, TEXT("Text Output: added vertices for mesh %d"), m);
	}

	return uvcoordinates;

I’m having a bit of a hard time understanding what you’re doing, my grasp of c++ is rough and I’ve never dealt with UE4s libraries, but it looks like you’re copying one of the UV channels. You don’t need to do that; you should be able to specify a channel per material and have it use that.

As far as whether or not the mesh is at fault, that’s east to check. Import the mesh in unreal and compare the UV channels to the diffuse/base color channel. Given how much distortion you’re getting there will be a huge discrepancy between them if that’s the issue.

Hello, I was trying to import a FBX 3D Object with Assimp und runtime mesh component into UE4. It creates a runtime mesh component without any Material. I importet the material separately into the editor.

The Problem is as follows:
After that I created the runtime mesh component I’m using the “Set Material” function in my blueprint to use the separately imported material on my Runtime Mesh Component.

For some reason the material looks bad without any detail. Only the color seems to fit.

When I use the “import” button to import the fbx file into the editor, the material looks fine, even though the same material was used. The size differences don’t matter here.

I hope, you can help me to solve that issue. Please recognize that I’m an absolute beginner so please try to explain it on a low level.

Thanks for help, Niclas

You didn’t supply UVs, so all the poly’s are gonna render the color at (0,0) in your texture. Multiply the normals by -1.