Game Development Community

Glow Shader, Material.cs

by PuG · in Torque Game Engine Advanced · 06/01/2007 (7:17 am) · 2 replies

Hi, is it possible for the glow function in the material.cs file be limited to only certain areas of the item texture? (perhaps using a alpha map?) - or doesi t only go of RGB values?

Also if you include a alpha in the texture does it have an effect on specularity (if enabled)?

Ive been reading through the TDN documents, though fairly good on basic items not clear on alpha channel related issues etc.

Best Regards.

#1
06/01/2007 (8:12 am)
I've never experimented with masking the Glow effect but I imagine it can be done. I do know that they Alpha Channel will act as a "mask" for the specularity effect. So if you only want part of your texture to have specular highlighting then using the Alpha Channel to define those parts.

Incidentally, someone at GG (Brian?): it would real nice if a separate "maskTex" parameter could be indicated in the Material entry. That would allow things like the Specular Mask to be separated from the Alpha Channel, leaving it (Alpha Channel) exclusively for Transparency effects. That might allow you to tie some other parts of the engine more "tightly" to transparency, like shadow casting for instance. Right now as it stands, there is no way for a single texture to be transparent in some parts, and partially Specular in other parts since both effects are masked via the Alpha Channel.

Anyway, that's just my two bits.
#2
06/01/2007 (8:38 am)
Thanks for the quick reply.

Just tried the glow texture with alpha channel and it doesn't appear to work :(

Agreed, having a separate "maskTex" control would be an ideal solution.