From: zap@lysator.liu.se (H}kan Andersson)
Newsgroups: comp.graphics,sci.image.processing
Subject: Re: Creating texture tiles
Date: 8 Sep 92 06:44:31 GMT
Organization: Lysator Academic Computer Society, Linkoping University, Sweden

(Hi Eric!)

About seamless textures...

To obtain seamless textures, I think I know of three methods that comes to
mind immediately.

* The mirror trick 

  Simply mirror you original textu:_e{_ in X and Y. You will get something
  that repeats back 'n forth, but it is seamless. The problem is that this
  tiling is often visible, and that the seam may still be visible due to
  the sharp bend of for instance wood veins in the flip-seam.

  HOWEVER: If you have an image manipulation package that allows you to
  'stretch' around the images a bit, using the flipped images per above and
  then fooling around with the center (without messing with the edges) may
  give a decent-ish result.

* Crossfading

  Assume you have a square scanned piece of wood. Let's give it a 
  0,0 - 1,1 coordinate range. 

  For simplicity, let us only discuss the X coordinate case.

  (Sadly, we only get a 0,5x0,5 piece of patternmatched wood out of a 1x1
  piece of original wood if one uses this exact setup, but...)

  At the left edge of the output image, do NOT place the left edge of the 
  scanned wood! Instead the middle (X = 0.5 in input wood) are used, so we
  go from (left of output) = (0.5X of input) and (right of output) = (1.0 X
  of input). However, we cross-dissolve this with another image, who has
  (left of output = 0.0 X of input) and (right of output) = (0.5 X of input).

  This gives us the exact 0.5 condition at the edges, with a smooth cross
  dissolve over the actual texture. Works quite OK for wood.

* Do it by hand

  In your favourite paint program, do something like any or both of the above.
  I recommend using a variety of the second trick. The problem is often that
  you try (often in vain) to make the EDGES match. Stop that. Shift the image
  by half it's size in X and Y (assuming wraparound), thus making the EDGES 
  THEMSELVES automagically matched. Then perform all fixing-up in the 
  'interior' of the image with stretching, overpainting, cut-n-paste,
  dissolving and all that jazz.

I myself use all three with increasingly good results going from the
first idea listed here to the last. Of course, an increasing workload is
imposed for each step down the list too :-)

The best result is the handmade one, even if the cross-dissolved can look 
good too. However, it can appear a bit blurrish in the 50%-50% regions, and
they can sometimes show as "blurred crosses" on the surfaces.

Perhaps an ideal one would be the cross dissolve with some kind of triangu-
lation morph of the image so one could assemble them to look good-ish near
the middle so the crossdissolve won't look blurred.

Just my 0.02 swedish crowns (speaking of wich we are just this authum stopping
the use of the 0.10 swedish crown coin, meaning that 0.02 swedish crowns is,
indeed, worthless)

/Z


  

  
--
!! The ANSWER   : 42     ("Hitchhikers Guide to the Galaxy" - Douglas Adams) 
!! The QUESTION : 0x2b | ~0x2b   ("Hamlet" - William Shakespear) | Dont Worry -
!! The EMAIL    : zap@lysator.liu.se  The PHONE: +46 16 96460    | Mail Zappie!
Newsgroups: comp.graphics