Home Unreal Engine

using alpha channel to change color of texture.

I would like to use a textures alpha channel to alter the color of the texture. I have a wall and would like to use the alpha channel of the texture itself to grime up areas of it. I am sure this can be done with just a few nodes in the material editor but I just dont know where to start.

Replies

  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Here's one simple way.
    ColorChangeShader.jpg
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    Vailias : with what youve done there that changes the color of the entire texture. if some of the texture color needs to be preserved wouldnt you want to multiply the color by the alpha, then multiply the diffuse by the opposite of the alpha and add the two together?
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    No, what he has done is correct based upon what you asked for. He hasn't coloured the pixels in the alpha mask (1.0, 0.6, 0.2), he's multiplied their original colour by that instead, combining the two colours.

    For the record though, there's no real benefit to using the alpha channel over a greyscale mask texture unless you're running out of texture samples.
  • knak47
    Options
    Offline / Send Message
    Well here is why I want to do this and what I was thinking. First i am limited to two 1024 x 1024 texture sheets on an asset. I want to get diffuse, spec and Normal maps crammed in there. So rather than take up space on the texture sheet with something I figured I could just have a alpha channel on a few and use them as masks. My plan is to get as creative with second UV channels and these Alphas. And I am not really concerned about performance at this point, although I am not even sure how much what I am planning on doing would effect performance anyway. Thanks guys, and any more ideas would be greatly appreciated.
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    You can do it, but why the limitation?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    @ambershee: The arena-net environment art internship test. Matches those specs

    @oniram: look closer. ;) I am multiplying the color by the alpha channel. If I were to multiply the base texture by the inverse of the alpha then add the two together, the the diffuse texture under the alpha would disappear and be replaced with the solid fill color.
    In this case the alpha is being used as a mask to modulate the diffuse with the other color.
Sign In or Register to comment.