Game Development Community

Per texel glow

by Brian Ramage · in Torque Game Engine Advanced · 11/09/2004 (9:17 am) · 4 replies

Some of you have asked to be able to glow just a few texels on a polygon instead of the whole piece of geometry. I realized recently that this is already supported by the current material functionality. All you have to do is add a second stage to your material with the texture that has the bits that you want to glow in it. Mark the second stage as glowing, and you're done. The glow texture should be black except for the bits you want to glow. It will blend the second stage on top of the first.

Example:

datablock Material(stony)
{
   // stage 0
   baseTex[0] = "~/data/textures/baseTex";
   bumpTex[0] = "~/data/textures/bumpTex";

  // stage 1
  baseTex[1] = "~/data/textures/glowTex";
  glow[1] = true;
};

#1
11/09/2004 (5:00 pm)
Some tips for choosing glow colors - glow is additive and smoothed, so very subtle colors can have major effects. Realize that the color will be added to whatever is below it, so you may want to dim the parts that are being "glowed," as well.
#2
11/09/2004 (5:06 pm)
Ben:

Kind of a stupid question here

Where can one get more information on shaders etc? I have never touched them before, reading posts like this one leaves me scratching my head

-Ron
#3
11/09/2004 (10:17 pm)
Yes, nVidia and ATI have a fair amount of information on their developer sites. There are also tutorials at sites like NeHe. In short, the vertex and fragment/pixel shaders act to make the functions that the fixed function pipeline does programmable. So instead of using the implicitly defined "multiply verts by the modelview" thing the FF pipeline does, you provide the shader with the modelview and the verts and process them.

Shaders are just a little more flexibility in the system, not any sort of deep voodoo.
#4
11/10/2004 (4:17 am)
Mm, I thought something like that would work, but for some reason I never tried, lol, so I ended up creating different peices of geometry and giving 'em different materials to get the glowing peice seperate :p - well, it was for lights so it didn't mater that much.