Creating wrappable texture from 2D pics

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Creating wrappable texture from 2D pics

Post by discipline »

I'm looking for a program (or preferably a way to do it in the gimp or blender) that will assist me in taking front, profile and back pictures of a head and morph it together to create a 2D image that I can wrap around a 3D object.

I know about unwrapping the mesh and then painting on the image. However I want to use actual pictures and go the other way. Does Texture Maker do this? Any ideas?

The result would look like the top one here, except created with real pictures:

Image
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

Let me ask this another way. I have a front, side and back pictures of a person's head. I can manually paste them together, then smudge, stretch and warp these pictures so that they are contained in a flat image, by using the gimp or photoshop. Then I can apply that 2d image to my 3d model. However is there a program or an automated process I can use to do this? How do other artists do this step? Is it all by hand?

Another example. I have pictures of the earth. How can I make something like a cartesian projection from those pictures so I end up with a rectangular 2d image?
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

hmm that would be usefull, i never get how people can paint on those stretched faces and make it look great still
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I don't know any program which can automate the processing of creating a single texture file from 3 photos.

However, take a loot at http://hugin.sourceforge.net/
( a lot of links in the link section you miht want to check. )

In this kind of softwares, which are mainly used to create panoramas, you can place several photos near each others matching some reference points, then equalize the images, and then export as a single image file per example, with no seams.

You can learn about that on the REALVIZ website as well, http://www.realviz.com/, but their tool named Stitcher isn't free at all.

I don't know if these technics are very applicable to what you are trying to do.

There are probably some equalizer plugins for Gimp, or Photoshop, which can help you with the equalizing task, but for the whole process I don't know any, and not sure one is existing.

Now, if you want to do some image based modelling, you have some tools like, again from REALVIZ, Image Modeler, which can capture the textures from the photos.

It's not exactly what you asked, but I hope this will help :)
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Re: Creating wrappable texture from 2D pics

Post by reimpell »

discipline wrote:I'm looking for a program (or preferably a way to do it in the gimp or blender) that will assist me in taking front, profile and back pictures of a head and morph it together to create a 2D image that I can wrap around a 3D object.
This is how I do this:
  • Model your mesh.
  • Take a semi profile picture of a real life object.
    Image
  • Open it with gimp, copy the layer, add an alpha channel, flip the layer, draw a gradient in the alpha channel.
    Image
  • In Blender, mark mesh edges as seams according to the texture, but at the "most invisible" places.
  • Use LSCM unwrap.
  • Pin uv positions to the corresponding texture image positions.
  • Pin both edges of a seam to be straight and of equal length.
  • Unwrap again.
  • Save the uv face layout.
  • Load that layout into Gimp in a mostly transparent layer above the texture to see it while working in Gimp.
  • Copy the region around one edge of a seam to the other edge of that seam and use the clone tool to make a smooth transition to the original image there. This way the seams are as invisible as possible.
  • Use Gimp's clone tool and Blender's texture image reload option to further enhance your texture. It usually pays off to clone to another layer, leaving the layer with the original image untouched.
User avatar
discipline
OGRE Community Helper
OGRE Community Helper
Posts: 766
Joined: Mon May 16, 2005 12:09 am

Post by discipline »

Thanks for all of the suggestions, guys. Oh and thanks to whomever moved this thread to artists/content creators. My bad. Reimpell your process is invaluable, thanks! I sense another wiki page coming! Just as soon as I get a process that I can get consistently good results with.

Reimpell, I understand the blender portion, having worked through their tutorials, but I don't get the alpha channel in the gimp. I added an additional alpha channel to my image, but that made it look darker. If I applied a gradient only to the alpha channel, it affected where it was darker and where it wasn't. I wasn't able to get the gradient or alpha channel to affect the overlay of one layer with another. :(

Deriving from your process, here's a pic starting with a left diaganol shot, rotated 10 degrees right so that the mouth/nose/brow are all vertical. Then I flipped it and drew the whole right side of the face with the clone tool. This only took a few minutes, and although rough, shows the concept.
Image

Next, I started with a front shot and used the clone tool exclusively, patching in left and right profile shots. Oh, and I cloned her left eye from the right, too. First I adjusted the colors of all input pictures. Then I started the seams with a 50% overlay clone tool. Then I went to 100% overlay for the rest of the patches. Finally I did a little bit of touch up with the smudge tool. What you see here is my second attempt at it. I think this shot would map to her face better than the above shot, because the central portion of her face is untouched.
Image
reimpell
OGRE Contributor
OGRE Contributor
Posts: 570
Joined: Mon Mar 01, 2004 10:35 am
Location: Hamburg, Germany

Post by reimpell »

discipline wrote:I wasn't able to get the gradient or alpha channel to affect the overlay of one layer with another. :(
If one uses Gimp, I think there is abolutely no way around reading Grokking the GIMP by Carey Bunks. This book will tell you all essential techniques you need for 2D image manipulation.

I think most artists start with two pictures: frontal view and profile, as done in this article by Paul Steed. But no matter what your initial graphical material is, the basic workflow I outlined in the previous post stays the same. The aim is, of course, to generate as few distrotion as possible. The semi profile approach has a low average distortion, whereas the frontal view approach has a better frontal view at the expense of the rest of the texture (which leads to a masked ball effect in the extreme case). Of course it's best to take the advantages of both methods by using frontal view and profile, but the results from semi-profile are often good enough. Using only one source picture considerably reduces your work: no correction for colour, illumination, scale and orientation is needed.

That's why I favour the semi profile approach. It's the best tradeoff between time and result for most cases. Especially if the resulting texture size is small anyway, there is hardly a reason to put more time and effort into it.

BTW, if you need to draw hair, it's often better to use a custom brush than the clone tool.
Post Reply