Home Unreal Engine

UDK - Color Suppresion - For RGB values

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all,

I was wondering if anyone had any tips on how would one go about suppressing certain values in RGB.

Basically, this is what I have currently as an example:

TexA x TexB

TexB should have certain values suppressed, like Cyan for example.

I tried a quick Saturation/Desaturation formula on TexB before multiplying it to TexA, but the results are iffy. If I kill my Cyan channel, it takes a good chunk of my Red channel with it, leaving only faint lines in place.

Also, playing around with the RGB channels directly in texture or even function wise (without some sort of dynamic control to it) leaves my vexed since I still get iffy results.

So yeah, gist of it is, does anyone have an idea on how to suppress certain colors?

Replies

  • AlecMoody
    Options
    Offline / Send Message
    AlecMoody ngon master
    can you show what are looking to do with a photoshop mockup?
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    Can you not mask out certain channels, fiddle with them, then append them back into the vector?

    I'm assuming you mean the blue channel. There's no cyan channel, but taking cyan out would mean you're only left with red; quite the opposite of what you're describing.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Argh, and me and my lack of coherent narrative of my woes ;P

    OK, so here is the example image of what I mean:

    69059372.png

    My GB is my Cyan, which has been set to 0 for both, while my R = 1.

    Now the problem comes from the Cyan still being existent at the border angles of the Red value, which is what I'm trying to, for a lack of better terms, oppress, repress and suppress (aka kill it).
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I'm assuming you can't just use color range in Photoshop to select the color within a certain range and desaturate it. Cyan is (0,1,1) and to desaturate it you would bring the values toward the same thing.

    The thing that I'm not absolutely certain about is what that same thing should necessarily be since the eye is more sensitive to certain colors than others and it depends on what you're going for. If you go into photoshop and use desaturate on values it only takes the values and brings them toward an average, but if you take the image and make it greyscale it applies some type of function that approximates the brightness that would be associated with a color.

    If you were to select just one color that would be pretty doable, but if you want to find an accurate range of colors to affect and have a falloff to depending on how close the color is, then you would have to find the distance between colors which is a bit complicated (according to Photoshop cyan comes out to about 89% brightness for example). It all depends what you're doing, whether you want to mute colors or just remove a color from a linear texture for the sake of multiplication.

    You could do several things, depending on the case. Off the top of my head for a brute-force way you could multiply the G and B channels and then subtract the R, and the value that's 1 would be Cyan, you could do if tests, you could add 1,1,1 and then divide by 1,2,2 and then subtract 1,1,1 and use that as an 'influence map' of some sort; I don't know I'm just brainstorming.

    Edit: in this case it seems it has to do with the falloff being different (some values take into account a bump map of some sort while the red isn't?), I'd say just fix the falloff issue if you can, or try a different approach (depending on what you're going for). You could desaturate(by averaging the values) of the whole thing (probably by using whatever is associated with the falloff in some way) and apply the colors after, all depends what you'd like it to do.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hmm, you're right, I think I might have an idea of what you mean, will be back ASAP.

    EDIT1: WUB WUB, might have solution, will test further and see result, this might just be the break I need for Blended Normal Approach.

    EDI2: WUB WUB WUB WUB, OK, no idea what the magic behind it is, but I decided to look up some HLSL and try to figure out if there are any min functions I could use limit the falloff, used a Min node for my RG values.

    Here is the result:
    18738471.png
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    Cool. What effect are you trying to go for? Keep in mind a dot product will give you a scalar value so it only produces a greyscale. If you are trying to make the shadows a certain color (such as red), you can add a scalar value to the result of the ndotl(map), clamp it, and then append the original result twice. You could control the intensity of the red with the scalar value. If you wanted to keep the black shadow that it fades to you could lerp between the scalar value and 0 using the ndotl(flat) as an alpha.

    Edit:
    dbscF.jpg

    I put this together quick as a possible idea; it's not exactly what I said above, I fixed a few things as I went through. The scalar value (I used .4 here) will decide how it transitions to black (when it's 1 all the black will be red).
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Awesome, will need to try this, thank you very much.
Sign In or Register to comment.