How does $color work in a material?

Discussion in 'Mapping Questions & Discussion' started by Jive Turkey, Jul 10, 2008.

  1. Jive Turkey

    Jive Turkey L3: Member

    Messages:
    120
    Positive Ratings:
    32
    Does anyone know how to use $color in a material file? The idea is I want several skins, which all use the same base texture, but each skin has a different color tint. I thought this would be accomplishable by having multiple skins each with a different $color value, but I can't get it to do anything. Here's my original material file:

    "VertexLitGeneric"
    {
    "$basetexture" "models/jp/crystal"
    "$model" 1
    "$surfaceprop" "glass"
    "$additive" 1
    "$translucent" 1
    "$nocull" 1
    "$envmap" "env_cubemap"
    "$envmapsaturation" 1
    "$color" "[ 0 0 1]"
    "%keywords" "tf"
    }

    This is for a model, obviously. I'm assuming this should be tinted blue, but it doesn't work. What am I missing?

    Furthermore, and this is something I doubt is possible, but is there any way to define the intended color within an entity itself? That way a mapper could change the color himself without messing with the material. I think there is a way to mess with the lighting origin, but then I'd have extra lights just to change the color of the thing. Kinda hacky.
     
  2. Altaco

    Altaco L7: Fancy Member

    Messages:
    485
    Positive Ratings:
    121
    I'm guessing the RGB values are probably out of 255, and that's what's wrong. Try it with [0 0 255] instead.
     
  3. Jive Turkey

    Jive Turkey L3: Member

    Messages:
    120
    Positive Ratings:
    32
    I actually did that by accident intially, but the documentation says they are normalized floats. Just like how $envmaptint works.