Home Technical Talk

Color Variation Mask

polycounter lvl 12
Offline / Send Message
dtschultz polycounter lvl 12
Does anyone know how to create a color variation mask like the ones you can find in UDK for their moss and plant masks? We used RGB masks on one of our projects, but they were to mask out specific parts of objects. The ones I am finding in UDK are more noise based. I'm sure I could create noise in Photoshop and just start creating selections and filling in areas, but I'd like to understand the process a little better.

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    all you have to do is feed a greyscale mask into the alpha of a lerp, and have one lerp input be your texture multiplied by the image or constant 3 you want to use for colour variation and the other input be your plain image.

    here is a quick example in one of my materials where im using a mask to colorize the brick grout.

    udk_masks.jpg

    the red channel of my mask texture is a black and white image that define where the grout is, which i plugged into a lerp, with input A being my diffuse texture multiplied by a constant 3 vector and input B just being the output of my diffuse texture.

    also in that material i feed the output of the lerp into a almost identical system that controls the brightness of the bricks that i got in a other channel of my mask texture, so it is pretty flexible and you can get lots of variation of you use 2 or 3 different masks to change different elements in your diffuse.

    udk_masks2.jpg

    hope this helps.

    a lot of it is thinking threw what you want to change. That mask texture has 4 masks that i use grout in the red, bricks i want to darken in the green bricks i want to brighten in the blue and i got a clouds texture in the alpha. so that the one mask texture lets me do quite a bit in this material, im using it for what you seen but also im using the red channel and the alpha channel combined to make a mask for vertex painting, and i manged to combine the 3 channels with lerps as a make shift height map for my bump offset instead of having to make a new texture for that.
  • dtschultz
    Options
    Offline / Send Message
    dtschultz polycounter lvl 12
    Thanks a lot for taking the time to post your shading networks and for explaining what you are doing! I have used something similar to what you describe here at work (although I only had to setup the textures, so it's helpful to see how your creating the shading network).

    What I am actually asking is how they made the textures they use. I should have taken some screens last night of the textures I am talking about. They look like sort of like noise, but I know they're more complicated than that. They may have just taken a portion of an image like some worn concrete. Made a tile out of it, and then made selections filling in certain areas in the red channel (for example) and removing that selection from the green and blue channels.

    One of the textures is used to mask out portions of their moss texture in vertex painting, so you can get clumps of moss when you vert paint. The other is a texture they use to give the plants color variation based on their world position.

    I wanted to try and make my own, but I can't figure out how they made these.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ah i know what you want this is what i did with my vertex paint mask.

    i plugged this into the alpha of the lerp for all the textures i wanted vertex painted, the what it does it make the grout with some clouds variation fill in first by the vertex paint followed by everything else. I can set the intensity low on the mesh paint and it will fill in cracks olny if i just quickly move over a area, or i can paint using a in between colour range to only paint in the cracks or paint everywhere.

    udk_masks3.jpg

    im pulling from 2 channels and multiplying since i wanted some noise in it and still wanted to use the red channel for something else but in your cause you could skip that first multiply, i have this transition mask plugged into multiple lerps for controlling my spec, gloss, normal and diffuse transitions.

    as far as the textures considering how they are used they don't need to be hugely detailed so just make selections of the diffuse and filling things in with the paint bucket works pretty good than adding some clouds or noise. In my case i made this all from a photo reference and ready hand made a height map for generating my normal map via ndo so i already had lots of nice selections and masks to use for the shader, and in the case of my original image it was just a matter of selecting colour ranges to isolate the parts of the image i wanted and using the selection to make a black and white layer, apply some light blur to get some gradient info out of it than fixing anything that didn't look right by hand with some brushes.

    here is a screen of the result of useing that mask.
    udk_masks_result.jpg

    the method i used for tne transition mask for the vertex paint is based off a method used in one of Chris Albeluhn tuts and about the varration using the world postion i never tried before but there is a tut for it by Chris also which can be found Here

    hopefully this is on target and you can adapt it to your need.
Sign In or Register to comment.