Escape Paint Module 'LIGHTING'

This EPM was just written for creating the graphics for
the EIL2 homepage (http://eil.atari.org). It uses some
kind of bumpmapping effect to achive effecs like chrome etc.

You have to use two source picture:

* a picture containing the information, where your 'objects'
  are (like the metal-drops at the eil-site)
  You just have to create filled 'outlines' of the shapes,
  you want to look metallic. (shape picture)
  
* a light-picture, which contain the 'object', which should
  reflected by the metal stuff.
  
I put an example light picture into the archive. It is the
same I used for the EIL homepage.

The Module does the following:

It checks for each pixel in the shape picture if it is inside
or outside. If a pixel is inside a shape (it is not black), the
module looks how long is the distance from the pixel to the next
edge of the shape. This information is used to calculate the
'height' of the pixel. Finally every pixel inside a shape has 
a 'height' - so you have something like a map of a landscape. 
After this, the map is illuminated using the light picture.
The illuminating is made using some kind of bumpmapping technique.

Parameters:

* Light source is the light picture

* Source picture is the picture containing the shapes

* Thickness is the maximum 'height' of an 'island'.
  You can achive good results, by setting this value to 16-30 
  Just play around with this. 
  The value of 0 has a special meaning: The map is generated
  directly from the source picture. That means you can directly
  generate the heights of each pixel by drawing a picture. This
  option can be used to create nice bumpmapping-effects with 
  existing pictures.
  
* Filter cycles: After the map is created you can apply a
  smooth filter to is to make the final result look smoother.
  A good value is 2, but just try out the other ones.
  
* Active Color -> Background: This option only touches the
  pixels that are inside a shape and sets all the others to
  the current draw color. This is useful if you want to create
  transparent GIF images out of your result. Just set the
  current color to a color, that is not used in the light
  picture and set this color transparent later.
  
* Bump Offset: This option allows you to control, how 'plastic'
  the result should be. If you choose a low value (1) the
  resulting shapes will appear very flat. The higher the value
  the higher the 'volume' of the generated shapes will be.
  A good value is 3, but its worth to try others.

Note: This module is only tested with 320x240 pictures. So I
      think it will bug with other picture sizes.

Hint: The resulting picture is tilable - so this module is 
      ideas to create stunning desktop of homepage backgrounds
	  (especially in combination with sindist).



some words in german (cut from a letter to Ulli Ramps):

Alles, was Du tun mut, ist eine weie Schrift (oder x-beliebige
andere Form) auf schwarzem Hintergrund zu malen oder zu generieren.
Ich habe hufig eine Schriftart von Calamus, die mir gefllt
ausgewhlt, den Schriftzug mit Calamus geschrieben und einen
Snapshot gemacht. Das SW-Bild mut Du dann irgendwie in Escape
Paint einladen. Ich empfehle Dir das Gemview-Loader-Module. Damit
kannst Du Gemview-Module von Escape Paint aus benutzen um Bilder
zu laden. Dann ldst Du noch ein Lichtquellen-Bild ein (zB. das,
was sich im zip-Archiv befindet "light02.xga"). Achja. Das Escape
Paint Module mut Du natrlich auch laden (im Modules-Fenster).
Dann kann es losgehen. Nachdem Du das Modul aktivierst wird ein
Parameter-Fenster erscheinen. Hier kannst Du das Lichtquellen-Bild
und das Quellbild (den Schriftzug) angeben. Die weiteren Parameter
haben die folgende Bedeutung:
Thickness: die max. Hhe des Tropfens. Wenn Du hier 0 einstellst,
           wird die Hhe des Tropfens mit einem anderen Algorithmus
           bestimmt. Damit kannst Du z.B. auch beliebige graustufen-
           Bilder als Grundlage verwenden. Einfach mal ausprobieren.
Filter:    Anzahl der Filterungen. Diese sind ntig, um das Bild 
           ein bischen weicher zu bekommen, da der Algorithmus zur
           Hhenberechnung der Tropfen mit Aliasing-Effekten zu 
           kmpfen hat. Faustregel: je hher der Wert -> desto flssiger
           das Ergebnis.
Background:Den Parameter kannst Du nur auf Null oder Eins stellen. Wenn
           er auf eins steht, wird der Hintergrund die aktuelle Zeichen-
           farbe von Escape Paint annehmen. Dies ist ntzlich, wenn man
           Grafiken als transparente GIFs weiterverwenden mchte. (wie
           auf der Homepage)
Bumpoffset:Damit kann man die Berechnung der eigentlichen Beleuchtung 
           beeinflussen. Ein hherer Wert lt das Bild plastischer
erscheinen.
           Gute Ergebnisse sind mit 1..4 zu erzielen.
Wenn man alle Parameter eingestellt hat, klickt man auf OK. Jetzt hat
man die Lichtquelle vor sich und mu auf den Punkt klicken, der spter
frontal auf den Tropfen scheinen soll. Versuch mal einen Punkt zwischen
den beiden Lichtquellen in meinem Beispiel-Lichtquellen-Bild. Dann wird
der Schriftzug von beiden Lichtquellen beleuchtet. Man kann also
prinzipiell
beliebig viele Lichtquellen verwenden. Man bentigt nur ein
entsprechendes
Lichtquellenbild. 
So.  Nun wird berechnet. Anschlieend wird ein neues Bild mit dem
Ergebnis
erzeugt.
Hinweis: Das Modul funktioniert nur mit 320x240 Bildern. Wenn Du grere
Bilder bentigst, mut Du sie vorher "zerstckeln" und spter wieder
zusammensetzen.
Hinweis2: Das Modul erzeugt kachelbare Bilder. Vor allem zusammen mit
dem
Modul Sindist lassen sich damit schne Homepage oder
Desktop-Hintergrnde
generieren. (Sindist wurde zB. verwendet um den Assembler-Hintergrund
auf der escape-Seite zu generieren)

...end of german :)


Some people asked me about further developments of Escape Paint.
Sorry, I just didnt thought that there is still interest in this
program. I you need a function in Escape Paint, that is useful
for you and others I will try to build it in (except, when it
is really to hard to do for me:))

Escape Paint has all functions I need, so there is no need
for me to improve it. You have to tell me if you want improvements,
ok? 


If you have any questions or suggestions, 
or if you want to take a look at the lousy sourcecode,
just write me:
nf2@inf.tu-dresden.de

Norman,

