Sunday, November 20, 2011

Texture projection

This weekend I spent some time implementing a rough version of the texture projection for MakeHuman alpha7. The ultimate goal is to be able to create a texture from the different reference pictures used to create a model. Currently it only uses the current reference picture, even when you have several pictures assigned to different views. While the projection code from Saturday still had a lot a lot of seams in the rendering, the one from Sunday fixes this, as you can see in the rendering below.

(In case you are wondering what image I used to project, it's one of the wallpapers from the local burger chain: http://www.mos.co.jp/)

There are still a few points which can be improved. The most noticeable in the rendering below is the texture sampling. I currently use nearest neighbor instead of bi-linear sampling, so it looks a bit aliased in places where the texture surface is much lower than the object surface. If you use a higher resolution picture, this shouldn't be such a problem.
Another improvement would be speed. Since 99% of the projection is implemented in python, it is rather slow at the moment. However I plan to write an OpenGL version once I have some time to add FBO (framebuffer object) support to our render engine.
Besides these two technical problems, there is the GUI aspect. As I mentioned before, we will need to combine projections, for example front and side view, to obtain a more usable texture as currently polygons orthogonal to the projection plane will have very washed out texturing.
We will also need to add a way to mask area's in the source image to avoid that the entire texture gets projected. Right now you need to erase the unneeded regions in Gimp or Photoshop and save the image with an alpha channel.
I haven't tried the projection with a real photograph of a face yet, as I was more interested in coding the projection than actually using it. But I'm sure some of you will try it soon.

Tuesday, November 8, 2011

MHX export to separate directories

Some weeks ago I made a change to mhx export that I forgot to mention. By default every exported mhx file is now located in a separate directory below the export directory, named after the character. Moreover, the relevant textures (skin, hair, clothes, etc) are copied to the textures subdirectory. There are three reasons for this change:

1. If you import the mhx file into Blender and then save the blend file in the character's directory, file paths are made local. The path of each image is changed from the global path to a local path starting with //textures (you may have to select File > External Data > Make All Paths Relative). This means that you can move the character directory to another computer where MakeHuman is at a different location, or not installed at all, without losing the textures.



2. Since every character now has his own texture, the texture can be modified in an image editor without affecting other characters.

3. Things are not broken if the textures in the MakeHuman directory are changed. This happened to me when I was working on a personal project. Suddenly my heroine had a lot of holes in her, because Manuel had changed the UV layout and the textures in svn.

However, if you don't want the separate directory, you can turn this feature off by setting SeparateFolder in mh_export.config to False.

Friday, November 4, 2011

SVN problem in linux

If you are using the nightly deb for linux and get the following error message:

D targets/mouth/images/mouth-width-min-max.png
svn: Server sent unexpected return value (502 Bad Gateway) in response to PROPFIND request for '/svn/trunk/makehuman/data/targets/mouth/images'

Then execute the following:

sudo rm -rf /usr/share/makehuman/data/targets/mouth
sudo apt-get install -y --force-yes --reinstall makehuman-nightly

This should clean up your local svn checkout and allow you to get the latest targets.
© MHteam 2001-2010