Page 1 of 1

Creating Illuminating Shaders

Posted: Tue Jun 23, 2009 12:04 am
by NotZachary82
Hello,

Welcome to my tutorial on creating illuminating shaders. These can be used to get a more realistic feel for your objects.

Before we start, you will need:
  • Adobe Photoshop CS4 with .DDS plugins (or any image editing software that supports .DDS files)
  • This [shad] plugin
  • Entity (any version)
Now, by the end of this tutorial, you should have something like this:
Image

Both of these cubes are illuminating white light (RGB: 255) from the shader.

Now, let's begin.

Tutorial

Open up your map in Entity and duplicate two bitmaps (both should be the same size, one preferably DXT 5, and the other preferably DXT 1).
Image

Save both those textures and edit them to your liking. The DXT 5 bitmap will be the diffuse, while the DXT 1 will be the self-illumination. Here are the RGB and alpha channels of my DXT 5 texture (top, left to right), as well as the DXT 1 texture (bottom).
Image

(I edited both sizes. The original tags were 128 x 64, the duplicated tags are 128 x 32.)

Now, illumination maps are black and white, so make the area that will be illuminating white, and the rest black.

Re-inject your new textures.

Now we need to find a shader that has illumination, or we could just make one. This is easier, however.
A nice illuminating shader is the plasma grenade decal: "objects\weapons\grenade\plasma_grenade\shaders\pg_decal".
So let's duplicate that.

Now find your new shader and "View" > "Idents".

Swap the highlighted dependencies.
Image
Red: The illumination map.
Blue: The diffuse map.

Now open up the meta editor, and be sure your using the [shad] plugin posted at the top.
Scroll to the "Specularity Colour | Illumination Colour" reflexive and select chunk 3.
Image

This is the overall color that your illumination map will give off. Edit it to your liking.

Now, go to chunk 1 and you'll notice the "Intensity" value. This is essentially an alpha of the illumination; 255: brightest, 0: none. Edit that to your liking as well.
----------------------------

Now, sign and test. If any problems occured, post them here.
I hope you all make the best of this tutorial.

Thanks for your time,
NotZac

Re: Creating Illuminating Shaders

Posted: Wed Jun 24, 2009 2:11 am
by Click16
Cool! this is useful.

Re: Creating Illuminating Shaders

Posted: Wed Jun 24, 2009 2:48 am
by xxpenguinxx
Hmm, I never messed with illuminations much. This gives me an idea.

Re: Creating Illuminating Shaders

Posted: Wed Jun 24, 2009 6:33 am
by neodos
Neat :P

Re: Creating Illuminating Shaders

Posted: Mon Oct 05, 2009 10:55 pm
by Aumaan Anubis
Moved to Tutorials.