Hey guys, if i have one object, 1 unwrap, that i need to have 2 seperate emissive colors. How do i accomplish this. Right now i simply have a emissive texture black/white and then am multiply the sample by whatever color i wanted them. But i need the text to be yellow while the light to be white. How can i accomplish this?
Replies
If you're going to use more channels in the texture for other things you can mask off one area from the other mathematically with a coords node, a channel mask, and an if block. Multiply the mask times the texture channel, then times the first color, then invert the mask (1 minus), multiply it by the texture channel again, then multiply it by your other color, then add the results back together and plug into the emissive slot.
For example, if you only need two colors, you could have 0.0-0.5 be blue, and 0.5-1.0 be yellow.
It's a shitload cleaner in HLSL, lol.
If you wanted to do more colors, I'll leave you with a short HLSL function that you can have fun translating to nodes.
so for example, if you wanted to split your value range into 4 bands, and you wanted the second band of values:
minRange = 0.25f;
maxRange = 0.5f;
Thats a good option Tekk. Reminds me of the gradient mapping discussion a while back.
You can nest these similarly to LoTekK's method, just having an additional set you can break it into quadrants or however you like by moving the division point. The IF node is pretty awesome.
You don't need to colorise the mask, but you'll need to alter the value range of the existing mask depending on what needs to be yellow, and what needs to be blue. Quickest way would be to select what needs to be blue, and run a levels on it. Just move the bottom sliders. Blue would be (0 - 127), while yellow would be (128 - 255) in the example.
Vailias: Haha, I know the feeling. I keep wanting to +1 stuff here This one came out of loving what Valve did with L4D2, but not being satisfied with being limited to only two bands, lol.
Phill: That's one option as well. It keeps things simple, though it sacrifices versatility, since it's an either/or. The node/shader solution I provided also allows you to modulate the brightness/strength of each of the emissive colors. It can be a bit obtuse to actually work with the textures, though, without some workflow tweaks to the texture creation/editing
-In photoshop paint white areas into the red channel where you would like one colour, then on the green channel do the same again for a different emissive colour and do the same for blue
-in the unreal editor import your new texture and multiply each individual channel with a vector to achieve individual colours.
-multiply it again with an int to control the brightness of the glow
Hope that helps.
When I was doing a 'hologram' project in unreal I used this method with material instances so i could use any colour.
Nick I guess you just need to think what you need the most and what's most optimised
http://teckartist.com/?p=26