KatsBits Community

[UDK] Blender UV problems

ward · 45 · 40242

0 Members and 2 Guests are viewing this topic.

Offline ward

  • Newbie
    • Posts: 33
I'll try with some images, thanks, I'll let you know if that helped in a bit, didn't think of trying that, I assumed it didn't mather.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Yeah it's a 'myth' that seems to persist in the UDK community for some reason; I know the tools can import 'blank' meshes, but that ability wasn't implemented or intended to be used as a legitimate step in the production process like that. There are no shortcuts to properly optimised and set-up meshes in other words.

An additional but incidental point you might want to look into is how you've done your UVW map, it's particularly important because of your wanting to use tiled textures. Right now what you have is this;



The problem here is that you've got UVW map sections pointing all over the place so if you assume for the sake of argument that you use a tiling 'wood' texture, it means the grain of the wood will also be all over the place. So... what you should ideally be doing is something similar to the following.. map each section based on *material usage* so all object that use the same material are pretty much (certainly as much as is possible) mapped to the same texture image. You ideally need to reconnect a lot of those smaller UVW islands back into larger segments, there are technical reasons for it but suffice to say here it makes your job as an artists easier come time to texture the mesh.




An Additional point as well is that if you UVW map similar to the above, you may then be able to bake ambient occlusion per-texture, per-group.


Offline ward

  • Newbie
    • Posts: 33
Is it a must to puzzle the islands back together? Faster to project from view those parts then I guess.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
In a word "yes", it's quite easy to do using UVW "Seams". Read this tutorial (for 2.49 and/or below)

Those technical reasons I alluded to previously are important to be aware off, essentially when you're making something you need to make it as easy and quick as possible for the game to do what it's trying to, UVW maps are interpreted by an engine the same/similar way to a mesh, so when it looks at a UVW like the one you originally did its having to work harder to read what's there.

Think of it in a literal sense.. look at the two images below. You can immediately see the difference between the two, the original being quite 'chaotic' because of the mapping - your eyes 'dance' all over the place as you try to make sense of what you're seeing, right? A game engine would pretty much do the same thing when looking at that mesh so it's always best to unify and simplify, the bottom image.




Offline ward

  • Newbie
    • Posts: 33
Thanks, the ASE script keeps giving me trouble though, I cannot get it to create material slots, but it also has these dark spots... I Guess it's just because not everything is rotated the same way, doing this by hand (basically fixing what smart projections ruined, it rotates the crap out of UV islands), or projecting them from view is going to take so much time that I guess I should just forget about it. Thanks anyway.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Read the tutorial linked to above, if you made the meshes in Blender then you'll already have the skills to address this problem and quickly fix it using Seams (Select an edge, "Ctrl+E > Mark Seam", then "Unwrap"). You've done some decent models (based on the test you sent through) so it seems a shame not to bring the UVW maps up to par as well. I'll see about sending you back the test you sent in the next day or two so you have something as a reference. Work on something else in the meantime so you don't burn out on these particular assets.

[EDIT] was just taking another look at the mesh, you need to go over it carefully and delete any isolated vertices and/or edges before exporting I found a couple attached to the beam sections. Remove those as they can cause additional issues if let in place.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Just discovered a potential problem that might explain some of the problems you're having. I imported the test mesh into UDK (Nov 09 and Apr 11 versions) to double check the meshes had been exported correctly. As you can see below the first image has 'black' spots similar to the problem you're having - they are smoothing related. The second image shows the mesh without this problem. Both meshes are exactly the same so the same export procedure was done to both (separate meshes are joined together, modifiers are applied before export etc).

The *only* difference between the two is that for the first export Blender wasn't using the full (correct) version of Python for 2.49 because my systems Python path is setup for 2.5(n) testing. On removing the path variable and re-exporting the mesh (to a different revision number) it appears to have exported correctly with mesh smoothing intact. (note the material references by the way).

This is a speculative assumption as I've only tested this on one machine (running 32bit Vista SP2) which is using Blenders own ability to self-discover where Python is installed (as you'll see in the console when starting the application). If you have the Python system variable in place, try deleting it - check Blenders console before hand though to see if it's the correct version or if its using it/found it.

If you still have problems, try detaching the mesh into its original elements, cleaning them up and them re-exporting, that's what all I did to get this to work.

Mesh exported 'incorrectly' because Blender isn't using full Python


Mesh exports correctly because correct Python references are used?



Offline ward

  • Newbie
    • Posts: 33
It's definitely not a smoothing problem, these black spots on my screenshot are complete area's that correspond with UV islands.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Yeah as mentioned in a previous post, those black splodges usually happen for two reasons, lightmap errors or smoothing (sometimes both), I can't really confirm either without being able to look at the entire mesh the test section belonged to so can you send that? You'll need to include details regards to how many textures the mesh should be referencing (names aren't important).

And you do mean these right? You said said there are problems with the mesh but haven't actually highlighted which parts are the actual errors - looking at the mesh without knowing what your textures are like, I can read quite a few problems in the image (highlighted below).


Offline ward

  • Newbie
    • Posts: 33
The 2 upper left circles, with the question mark in between, are just lighting artifacts, don't mind them, they disappear when lighting is built. The others are indeed what I meant. I meant just the parts that are obviously much darker, on both the wood, and the yellow material. I didn't have much time for it lately. But when I have time I will either try to unwrap one of my models correctly by hand (to see if it looks ok then), or try to remove the code portion that rotates the islands out of the smart projections script. (If you have any tips on that, very welcome of course.)

I'll let you know if this works out, if it does not I'll email you one of the models in the screenshot, the testcase is indeed just a part of a model, thought that would be more practical.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Have you tried just doing a quick test and unwrapping one of the buildings UVWs so they're contained within bounds? If the problem appears to be associated with the UVWs extending beyond the texture borders just remap them inside and see what results you get when you then export with and without the second lightmap UV layer.


Offline ward

  • Newbie
    • Posts: 33
No, but I modified the smart projections script from blender 2.49b (uvcalc_smart_project.py) , to not rotate the crap out of my UV's while packing them, now the output is much better, everything in the correct direction. Only sideeffect is that i have to rotate the UV's for slim horizontal parts manually, but that's just a few seconds, and any other angle then horizontal still gets made vertical by the script :) . I just tested this with one of the models and so far so good, I'll let you know after I tested some more.


Offline ward

  • Newbie
    • Posts: 33
The dark spots are gone, but I keep having small problems, to be clear: I'm using the FBX exporter builtin in blender 2.49b, not the ase export script. I'm going to quit it for some time, I've had enough of this crap for now.


Offline kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
Send me one of the buildings if you want and I'll take a look at it.


Offline ward

  • Newbie
    • Posts: 33
A couple of the models are unwrapped now, almost without any problems, I spotted a few problems that are so minor I don't mind them much. I even distorted the models to make them look more realistic/not straight. If I have more problems I will email a model. First I'll unwrap the others too as good as I can. Smoothing and everything now works nice with the FBX exporter on 2.49b (with edge split modifier though, no real smoothgroups). Disabling some rotate stuff in the smart projections export script is mainly what solved the dark spots problem. And the only trade in is dat now I need to rotate horizontal parts of the model by hand (so all the other slim islands are still automatically rotated to be vertical).

The ASE script was giving me trouble because apperantly it requires a unique texture / material channel (or what is it called), but the .FBX just seems to do the job better for me. I also tried the updated version of the ASE script for 2.57b (at the UDK forum iirc, I saw your name between the messages too). Kept having trouble with both.

And something unrelated to the problem I had (but problably not worth to open a new thread): Someone told me that if a mesh has 7 materials for instance, the intire mesh will be rendered 7 times, is this correct or bs? If it is I guess creating components per material is the best way to export i guess? Now I just export the intire models.