Home Technical Talk

Explaination of RGB channels

I've been working with 3D for a while now, but I've never used the RGB channels in texturing. What I'm looking for is a tutorial, or an explaination of how they work and how to implement the RGB channels into my work, from step 1 to finish, because I'm completely in the dark of how they work.

Can anybody help me?

Replies

  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    What do you mean by RGB channels? You mean use them as masks? In which case it honestly isn't any different then texturing normally, other then using color to dictate what masks what (so anything painted red = r.mask, green = g.mask, etc) and then you use that in the end product.

    And naturally, it also depends on your shader/material, and if it has any nifty magic in it to make things work.
  • Visceral
    Options
    Offline / Send Message
    Basicly, to make things simple think of any image as 3 grayscale images combined.
    I packages like UDK you can easily access theese channels individually so you can use whats called gray packing to use 3 or even 4 textures inside 1 RGB texture.

    What you do is you paste the grayscale mask into the corresponding channel in Photoshop, the combined image will look really funky, but inside UDK you can acess them to create variation/masks anything you can think of.
  • interrogator_chaplain
    I'm just unsure of how they get used in the first place, and how to work them into an engine.
  • Eric Chadwick
    Options
    Offline / Send Message
    Some process info here (see The Desert for example)
    http://wiki.polycount.com/Multitexture
  • repete
    Options
    Offline / Send Message
    repete polycounter lvl 6
    This is a great vid from Pat Crandley on the topic. He is using modo but it is a universal workflow and one you should learn from the offset. It can be a bit daunting at the start but it's like learning to ride a bike :poly136:

    [ame="http://www.youtube.com/watch?v=tsa2jRHyV7M"]Texture Setup - YouTube[/ame]
  • interrogator_chaplain
    Visceral wrote: »
    What you do is you paste the grayscale mask into the corresponding channel in Photoshop, the combined image will look really funky, but inside UDK you can acess them to create variation/masks anything you can think of.

    So, forgive me if I get this wrong, but you take a diffuse map, change it to greyscale. Then open up a seperate diffuse map, go into this new diffuse map, delete the blue channel and paste the old diffuse map inside it and hide its visibility. Take this into UDK say, and then hook the blue node into the diffuse node?

    Again, forgive me, I've never done this before and its confusing.
  • Eric Chadwick
    Options
    Offline / Send Message
    Yep, that's basically it. Except you're pasting three different grayscaled textures into a single texture, pasting one into each of the Red, Green, and Blue channels.

    repete... that's a different technique, using colors to mask different layers.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    I'm just unsure of how they get used in the first place, and how to work them into an engine.
    It depends on the engine and if does support them, you first need to check that out, not all engines will take a Stack/Mask Map.

    As you mentioned, in the case of UDK is pretty simple, Mutiply the R channel by a color and put it into a diffuse, and done, in other engines (if they don't have a shader creation system in place) you will need someone to make that material available for you.

    Also, remember to try and avoid using any CMYK colors, since those will 'mix' the the colors and you will get unwanted parts of an effect to show up in your masks, especially if you're new to this, just keep it simple.

    Lastly, you also have access to your Alpha, so you have in theory access to 4 masks in a single texture, but not many people will use the Alpha channel since it can get pretty expensive sometimes.
  • Goat Justice
    Options
    Offline / Send Message
    Goat Justice polycounter lvl 10
    RGB or RGBA channels are just the component parts of a digital image. Every pixel has a red green blue and alpha value. The channel for a color is the greyscale image made of just that value for each pixel. http://en.wikipedia.org/wiki/Channel_(digital_image)If you've ever made a texture in a game engine, you've used RGB channels for texturing. Some engines allow for setting up materials that use the channels in unusual ways or split them apart to create various effects. I get the feeling this is what you're asking about, but its a pretty broad topic.Is there a specific effect that you've seen somewhere that you are trying to duplicate?

    RGB values can also be assigned to vertices in a 3D model, and sometimes used to blend multiple textures, but that's not really an image channel.
  • Coexistence
    Options
    Offline / Send Message
    Coexistence polycounter lvl 7
    Each color is made up of some mixture of red, green, and blue. the red, green, and blue values are added together, you get your color.

    Say you have an image that is completely red. If you look at the channels, you'll see the red channel is white, while the green and blue channels are black. If you have a completely white image, all three channels will be white, since white is made by adding red, green, and blue together. A black image will have all black channels.

    In an average diffuse map, the red channel will be white where is a lot of red in the mixture, and black where there is none. The green channel is white where there is green, and the blue channel is black where there is no blue.

    Since diffuse maps are RGB (or RGBA, with the alpha being the fourth component) Texture Sample nodes have 3 (or 4) channels, just like in Photoshop. While you plug the black output (which sends all 3 channels) into the diffuse, you can take any one of your channels from your image and plug it into, say, the specular. This way, you don't have to import another separate image just for the specular.

    Another way of using these channels is to combine greyscale images into one file. Say you're making a sky, and you need a couple greyscale cloud textures and a starry background texture. You can multiply these greyscale images, one by red, one by green, and one by blue in Photoshop, then set their blend mode to Linear Dodge/Add. Bring the resulting image into UDK and you have all three of your greyscale textures in one file.

    Note: The greyscale images will only be colored if they are together in a node. Separately, they are black to white.
  • interrogator_chaplain
    I get the feeling this is what you're asking about, but its a pretty broad topic.Is there a specific effect that you've seen somewhere that you are trying to duplicate?

    I'm looking at the work from Snefer on his modular texture environment ( http://www.polycount.com/forum/showthread.php?t=89682 ) and trying to understand how he used the RGB channels to create what he did. And I'm just not sure what the steps are to accomplish this result.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Why not download the scene and take a peek at it?
  • Goat Justice
    Options
    Offline / Send Message
    Goat Justice polycounter lvl 10
    Like Ace said, probably best to download the scene and look first hand.

    I don't want to speak too much to what someone else was thinking, but it looks to me like he's treating the channels as separate greyscale images (with the exception of R&G for the normal map). I would imagine hes using a variety of processes within the UDK material to add and mask out color tints, create spec maps, and produce the final look.
  • interrogator_chaplain
    Alright, I'm going to try and go through everything that everyone has said here and figure it out. I'm still not totally sure what's going on, but I'll resurect the post as soon as I inevitably run into more questions.

    Thanks everyone for replying thus far, I appreciate your patience and your replies.
  • Eric Chadwick
    Options
    Offline / Send Message
    Snefer's image in this post should help.

    The first texture is RGBA, the 2nd texture is only RGB (for the normal map). He can re-purpose the blue channel part of the normal map for something else, because he included nodes in the shader to dynamically recreate the normal map blue channel data.

    TileExplain.jpg

    It might help to think of a RGB texture as just a container for a bunch of separate grayscale textures. The shader doesn't care that they're all stuck in a single bitmap. In the shader you can simply link the red channel to diffuse, the green channel to specular, the blue channel to emissive, the alpha channel to transparency, etc. Whatever combo you want.
Sign In or Register to comment.