Hi Polycounters!
Are there any particular ways in which to recreate some Photoshop blend modes within UDK's Material Editor?
(Blending between two textures instead of blending between layers.)
I know the simple ones:
Photoshop's Multiply = UDK's Multiply
Photoshop's Linear Dodge = UDK's Add
But are there any relatively simple ways to achieve Soft Light, Overlay and Screen blends etc. in UDK?
Thanks!
Replies
I had no idea that UDK had it's own set of pre-created Material Functions.
@LoTekK that would be great, thanks
Tonight, I shall have a blast at combining the Multiply and Screen blend functions in UDK to achieve the Soft Light blend effect for some nice grunge.
and some more general info:
http://www.laurenscorijn.com/articles/colormath-basics
Looking for the default blending from photoshop.
or 2 textures togeather.
So Texture 1 goes to slot A (this corresponds 0 value or black), Texture 2 goes to B slot (1 value or white), and Alpha can be a constant 0-1 range that controls amount of the blend. For example 0.3, blend 30% Texture 1 and 70% of Texture 2. This is the same thing as opacity blend where you drag the slider of the top layer. Also, like in PS you can use some greyscale texture mask for it.
Is this what you wanted or something else?
yessss...
Basically here is my situation, i have 1 texture that needs to stay static, and another texture that can change color on the fly to match the other texture's colors.( basically darken it)
I can match the colors pretty close in photoshop, but not in UDK.
Here is what I'm doing in photoshop.
step 1: copy a strip of the darker color so that i can visually match the subject texture to it.
Step 2: copy the subject texture to a new layer than multiply it by 100
step 3: make a new layer than use a black texture, and blend its layer on Normal to 44%
(if u notice the textures now match with exception to bottom because of the gradient on the static texture)
Here is the Result
Also Lerping is one way to do it, however when one of your slots is pure black, its really the same as multiplying to a 1 vector constant. Even better, use Scalar parameter for it and make Material Instance so you can iterate more quickly without recompiling the shader every time you make a change.
Step 2 I really think you should do in photoshop and contrast it there, because multiplying texture onto itself in shader makes math needlessly more complicated (except 0 and 1 everything else gets squared, so 0.5 becomes 0.25 etc. add 3 channel composite to that and it's a mess to track the result). You can do some brightness/contrast control though by multiplying to a constant then passing it to the Power node and do exponent of some other 1 vector constant.
But if you want to over complicate things and have some reference to match the color, here's the setup without that step 2 (you can add that too if you want). In the end when you've found the value you need, just leave texture with multiply part and delete everything else.
Bottom part is Solid right gradient from link here: http://udn.epicgames.com/Three/MaterialMasks.html
Since you used 16x16 grid here that 0.0625 will mask out on the left side 1/16 of the reference dark texture 15/16 to the other texture so you can compare them both. Add with TexCoord and 1.06 and 1, will offset the texture by 6% to the right, again just for easier color matching. Multiply part is self explanatory. Make Material Instance, find "Darken texture" value you need, delete parts of the material you don't need when you're done. Once more I really think this is over complicated, but if you really need to match colors, this should do the job.
http://www.abload.de/img/matsetupoxuj5.jpg
That seems pretty interesting, but is there a way to see the actual materials? I can't make anything out from those small shots.
I wish that i could do step 2 in photoshop,as it would ruin the other use for the texture when its in its in its unchanged color state.
I had attempted the power nod setup to try and build step 2 with that but it seems to lose some color data on a few pixels.
Yeah I could get better color matching with SRGB off although the overall shade of the textures were really desaturated feeling.
EDIT: here is the link to the UPK, if anyone would like to take a shot.
http://depositfiles.com/files/shjwxxnoz
Does anyone know if the performance hit is more severe adding an overlay image to a texture in UDK or just doing it in Photoshop and importing as a separate image?
Or is this a 'how long is a piece of string' question?
any extra stuff done in UDK will cost more. if you do it in photoshop its just one image. if you do it in UDK its atleast 2 images plus the shader nodes to do it
Rather than making a clean texture and grunge texture in PS and combining them in UDK.
Thanking you kindly.
But if only a few textures needed dirty versions, then maybe an extra couple of textures would be fine.
Ain't figuring out optimization grand?