Texture doesn't fit the model in-game

Hi

I’ve got something weird with one model, in Blender it looks like this:
house2

I used the Urho3D-Blender plugin to export the model, I successfully got the model, material and texture files, but when used in, it look like this:

house

It doesn’t match the size of the model, I think the wrong technique is used in the material (Techniques/DiffNormal.xml). I didn’t did anything special in the code:

					StaticModel* Object = tileNode->CreateComponent<StaticModel>();
				Object->SetModel(cache->GetResource<Model>("Models/medium_h_1.mdl"));
				Object->SetCastShadows(true);
				Object->SetMaterial(cache->GetResource<Material>("Materials/Mittel_Haus.xml"));

I put the blend file here: https://ufile.io/8po1d

thxs

1 Like

Hmm…, with the exporter, I’d make sure you exported the UV coords. At least, that’s what it looks like initially… I could be wrong though. I hope you find a solution to your issue!

1 Like

Hi! It seems like your model have two UVs channels ( UVTex and UVMap )
first uv fits unwrapped model right, but last UV seems that not
so you may try to delete broken uv (?)
or try add postfix “__UV1” for proper uv data set “UVTex” +"_UV1"

https://github.com/reattiva/Urho3D-Blender/blob/master/guide.txt

Blockquote
=====
UV
=====
To export UV you need an UV map, you can see the list in the Data page of the current selected object.
The Urho MDL format supports two sets of UV coordinates. You can specify what maps to use by appending “_UV1” or
"_UV2" to the layer name. These suffixes can be used together but also alone, if they are missing the first used
layer will be chosen.
If the exporter reports some “Invalid UV” this means that some triangles of the mesh are mapped in the UV map to
triangles with an area null or too small. You need to increase the area in the UV map, you can set the option
’Select vertices with errors’ to find these triangles.

1 Like

I tried using AssetImporter with the exported fbx, and parts of the texture were correctly applied on the generated mdl, but the result still looked far from the original. I’m a total newbie with blender, so far the Urho3D-Blender plugin is working great. I think it’s just some tweaking matter

Here’s the report from the Urho3D-Blender plugin when I check the “Merge Objects” option
Image2

Hey there crisx,

The blend file model does not seem to be game ready and so you need to do some fixes. So here you go…

house

I see you are doing a toon style game there and so the new blend file is setup for diffuse only to keep it simple, but it should not be a problem in case you need to add normals, specular, etc. This is now Urho3D Blender Add-on export ready with the exported sample files.

medieval_house.zip: https://ufile.io/paz48

Hope that helps.

3 Likes

Thanks rasteron,
I’ll try what you said on other models I’ve got problems with,
I’m still learning how to use the Urho3D Editor properly