0
$\begingroup$

I have a hut model, here in blender from a game. I would like to export it to source engine.

enter image description here

It uses this texture below.

enter image description here

When I imported the model into blender, the textures didn't mirror like they do in the game I exported it from. They should look like this:

enter image description here

But when I export it, It actually looks like this in my editor:

enter image description here

It tried mirroring the texture itself in paint.net but that made it off center and look even worse.

enter image description here enter image description here

My Only Option I guess is to manually edit the UVs So that it only covers the skull half of the texture. The other half is used for some other object in the level.

Can anyone show me how to do this? My UV editor looks like this below, when I select all the faces with that specific texture on.

enter image description here

$\endgroup$
1
$\begingroup$

For this, I dissolved the diagonal line going through the middle of my face. I then created a vertical loop cut down the centre of it, like so.

enter image description here

I then Went in the UV editor, selected all the edges of the left side of the face, and moved to be on the skull side of the texture.

All that's needed now is to download the UV: Magic UV Plugin, available in edit/preferences/add-ons, right click UV Unwrap Faces/Flip Rotate UV.

Done

$\endgroup$
1
$\begingroup$

That texture and UV map look like they were designed for a "mirror border" texture lookup: when the texture lookup uses UV outside of 0,1, it mirrors the image over the nearest border. This is a good way to save texture space that is often used in game engines, but Blender doesn't have built-in functionality for it. It's similar to "extend", "tile", "clip" options in an image texture node.

Even though Blender doesn't have built-in support for this border mode, it can be emulated in nodes:

enter image description here

Of course, that can all be combined into a node group for easy re-use.

However, when emulating border modes, there is a risk of getting texture filtering errors. In your case, you'd see these filtering errors as a vertical line through the middles of your skulls. This can be "fixed" by disabling texture filtering (by changing the image texture node's filtering method from the default "linear" to "closest"), or can be minimized by using "extend" border mode on the image texture node (although there may be some poor interactions with the occasional UV map in conjunction with the nodes I've demonstrated), but you can't really get proper texture filtering with a mirrored border until Blender supports it directly.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.