Creating Illuminating Shaders

This if for tutorials and information for the community to use for great works.
Keep them organized now!..
Post Reply
User avatar
NotZachary82
Posts: 1846
Joined: Thu Dec 20, 2007 8:39 pm

Creating Illuminating Shaders

Post 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
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: Creating Illuminating Shaders

Post by Click16 »

Cool! this is useful.
Image
xxpenguinxx
Posts: 1974
Joined: Sun Jan 27, 2008 4:50 am

Re: Creating Illuminating Shaders

Post by xxpenguinxx »

Hmm, I never messed with illuminations much. This gives me an idea.
DemonicSandwich wrote:See that? You see that how it is highlighted down here but it's not highlighted right there? Ah, I guess that's what I get for pirating it.
In Soviet Russia, DS touches you. Say it again and I'll do more than touch. ~DS -Oh baby
A cat was licking itself to the sound of potato chips.
User avatar
neodos
Posts: 1493
Joined: Sun Dec 09, 2007 8:58 pm

Re: Creating Illuminating Shaders

Post by neodos »

Neat :P
User avatar
Aumaan Anubis
Staff
Posts: 1812
Joined: Thu Dec 13, 2007 12:18 am
Contact:

Re: Creating Illuminating Shaders

Post by Aumaan Anubis »

Moved to Tutorials.
Post Reply