______________________________________________________________________
                   Special Effects for DX Games v1.00


Made by:   Jotaf98 (Joo F. S. Henriques)
E-mail:    jotaf98@hotmail.com

______________________________________________________________________
                              Overview

This is basically a DLL made in VB to allow other VB games that use
DirectX to use software-based special effects, instead of depending on
the user's graphics card. It includes 18 effects, some of them are
very neat and I never saw them in other games!

Setting it up for your game is not complicated, the instructions are
long just because I decided to give you detailed informations, so you
don't even have to think ;)

Also have a look at the effects descriptions. Some of them look the
same in the demo when in fact they're not. These descriptions also
include suggestions for using them so you might get some good ideas
out of it :)

______________________________________________________________________
                    Instructions For The Lazy Readers

Here's a very short version of the instructions and info for all of
you that don't like to read much :)


() Instructions:
   1) Add a reference to the DLL "pSpecialEffects"
    2) Add the module "mdlEffects.bas"
    3) Call the function "InitSpecialEffects" when you initialize DX
    4) Call the function "SpecialBlt" along with the number of the
       effect you wanna use

() Effects List:
   0     - Add/Additive Blend
    1     - Subtract (hard to use)
    2     - Subtract, corrected
    3     - Enhanced Add Effect/Alpha Map to White
    4     - Enhanced Subtract Effect/Alpha Map to Black
    5-12  - Translucency
    13-17 - Weird Effects

______________________________________________________________________
                            Instructions

Just click "Project > References..." in your project's menu. Then look
for "pSpecialEffects" and check it.

You'll also need to add the mdlEffects.bas module to your project, by
clicking "Project > Add Module..." and selecting it. This module is a
"wrapper" for the DLL, it makes sure that by passing the DLL the
arrays you don't get any errors. If you modify this module, you'll be
able to use the DLL for any graphics engine, other than DirectX.

To initialize the special effects, just call the function
InitSpecialEffects. You can call it from anywhere, as long as it's
before using SpecialBlt.

To blt using one of the effects, call the function SpecialBlt. You'll
have to pass it the surface and description of each of the images
(source and destination) [SourceSurf, SourceDesc, DestSurf, DestDesc],
the position at which the source image will be drawn to in the
destination image [dX, dY], the position, width and height of the
rectangle you want to blt from in the source image [SrcX, SrcY,
SrcWid, SrcHgt], and finally the index of the effect you wanna use
[LookupTableIndex].

______________________________________________________________________
                            Effects List

Here's a list of all the lookup table indexes (or just effect indexes)
that you can use in the SpecialBlt function, including their name, a
short description of what they do and possible applications (might
give you good ideas for your game ;)


() 0 - Add (also known as Additive Blend)
   This is a very cool effect that will make the destination image
    brighter, so it's good for lights, fire, explosions, lasers...
    Brighter means more opaque, darker means more translucent. Black
    is completely transparent. This is the way most graphics cards
    use translucency, though it's not "real" translucency.

() 1 - Subtract (with no color correction)
   This is a not-so-used effect that will make the destination image
    darker, so you can use it for black smoke, dust, or "black magic"
    effects. This one is a matter of experimenting with different
    images to see if it suits them. It inverts the colors of the
    source image but not its brightness, so it's a bit harder to
    handle with.
    Darker means more opaque, brighter means more translucent. White
    is the transparent color here.

() 2 - Subtract (corrected)
   Just like the above one, but you don't have to worry about
    inverted colors in the source image! In this effect, black is
    the transparent color. You can use it just like the Add effect,
    except that it will make the destination image darker instead of
    brighter.

() 3 - Enhanced Add Effect (Alpha Map to White)
   This is a trick that uses the source image as an alpha map, and
    White as the source color. It's an enhanced Add effect, because it
    makes the destination brighter, but not too much, and the result is
    a much smoother and natural-looking image! Definatly one of the
    best "eye-candies" available that will impress everyone when you
    show them screenshots. I never saw a game with this effect.

() 4 - Enhanced Subtract Effect (Alpha Map to Black)
   Same thing, but makes the image darker!

() 5 to 12 - Translucency
   The effect you've all been waiting for: translucency! And it comes
    in 8 different levels of opacity, and also supports black as the
    transparent color! The effect with the index of 5 is the most
    opaque one. 12 is the most transparent. Good for glass, liquids
    and ice.

() 13 to 17 - Weird Effects
   5 weird effects, using functions like Sin or Sqr. Try them in
    different spots of the image to see what I mean! These are REALLY
    cool if you use them well! They usually get more translucent with
    darker backgrounds or merge with the inverted background colors,
    making it look like light was distorted somehow in that spot. For
    this reason they can be used for teleporters, dimensional portals,
    creatures from other dimensions, power cells, and most magic
    stuff.

______________________________________________________________________
                            Sample Project

I've included a sample project. If you didn't understand the above
explanations you can look at this one and see how it works. In this
sample I used a not-so-common method, which is to use a UDT that
contains the surface and description of each image. But basically it
works the same way, it's just that this way it's more organized :)

It also demostrates a simple technique to make the effects faster,
which is to load the effects to video memory.

______________________________________________________________________
                             Legal Stuff

You can use the included DLL freely as long as you put my name in your
game/application's credits. If you want to modify, use ANY other part
of this code, or not give me credit for it you'll have to ask me for
permission first by e-mailing me to jotaf98@hotmail.com
I am NOT responsible for any damage it might cause to your computer or
anything else, but that's not likely to happen :)

You can also e-mail me with suggestions, comments or bug reports.


Have fun! ;)
