Home Technical Talk

[Unreal 4.12.5] Sample grundge map gets darker with each LERP connection [SOLVED]

polycounter lvl 11
Offline / Send Message
daniellooartist polycounter lvl 11
Issue

I'm trying to composite a bunch of grunge details together. However, my final result looked almost... empty. It's as if almost all of the detail I added just didn't show up. I thought I hooked up the nodes wrong. I hooked up the nodes correctly, but I still had this error. Normally in substance designer I can take one translucent image, a second translucent image, then pump them both through a blend layer. I would just leave the blend mode to copy. I can do this as many times as I want. But LERP does not work like that.

Solution (Update)

Unreal will not carry an objects alpha value over multiple nodes. You will effectively be re-blending over and over again. The solution is to pack the maps. The maps I had issue with were exported from substance Designer as 3 whole maps instead of a bunch of independent maps. Those 3 maps were... Albedo, Roughness, and all the previous mask composited as 1 mask in substance designer using a bunch of screen blends. That way I'd only have to LERP it once.

Steps to resolve

I do what I normally do. Take out more and more stuff until I isolate the systems in which the core problem resides. Normally the hardest part is finding the problem. Solving it is the easy part. This time it's backwards. The problem is that LERP does not work like SD's blend/copy node. With LERP, the first alpha value will stack with the second alpha. Thus the quality of the mask will degrade with each generation. Sort of like taking a camera and shooting a movie after said movie appears on screen. I understand the problem, but I can't fathom how one would even begin to fix it. I know it's possible, because I've played several games that were made with the Unreal. People have stacked dirt detail successfully before.

Any ideas?



Specs
Unreal 4.12.5
OS: Windows 10 Pro (Build: 14393.222)
Video Card: Nvidia GeForce 980 GTX (Driver: 372.90)

Replies

  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    I don't think you are using LERPs properly. By piping the alpha into the first LERPs, you aren't making a translucent image, you are simply blending you dirt/light/dark inputs with black (lack of LERP input defaults to black). Then further down the line, by not using an alpha with the other LERPs you are blending them together with 50% opacity so it will wash out the detail.
  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    I see. I guess it could work if I use alphas with absolute values. I could make it work with a CheapContrast node. But is it possible to blend them as if it was a Blend/Copy node like in Substance? I'd prefer my alphas keep their translucency but not get killed off over generations.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    Well, if you think of layering these blends you can get what I think you're after. You can also use whatever sort of alpha you want doesn't have to be 1 bit.
    Something like this:

    You have to think of the order which these things blend, I emulated what you had in your graph which is dirt over the base, then light, then dark.
    You would modulate your alphas to control how strong or weak the blend is for a particular LERP.

    As far as i know, the way you were using LERPs, if you did the same thing in substance designer it would do the same thing ie: blend node with 50% opacity. Maybe show a screen of what you were trying to replicate in substance.

    Also a thing to keep in mind is in substance you are able to use different blend modes within the blend node, whereas in Unreal you kind of have to split it up like this (unless you make your own material function to do this):

  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    Substance is a bit different. Unreal will fill in the blanks with a black background. However Substance will preserve the alpha throughout the entire upstream chain (image at the bottom).

    I'm playing with so many mask. That's the reason I've reached the material limit. I don't know. I see guys like Polygoo and Figmentpigment create these super high detailed crisp textures and think "This had to have been rebuilt through the material." But they would have to somehow be able to stack all those various ware and scuff detail all in series without killing the alpha detail. I'll get back to you when I pack all my colored mask more efficiently.

     


  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    I'm having trouble tiling a component mask. Normally I'd do this to the texture itself, but I have 4 grayscales packed into a single targa and I want to tile certain ones independently. How do I do that? I know it's probably something really easy that takes 5 seconds, but I've been waterboarding the internet for information for over an hour now and it's not coughing it up.


  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    I'm having trouble tiling a component mask. Normally I'd do this to the texture itself, but I have 4 grayscales packed into a single targa and I want to tile certain ones independently. How do I do that?
    You would have multiple texture sampler nodes (since it's the same texture map it isn't like having 4 different textures) and you use a texcoord node input into the UV slot of each texture sample.

    You can manipulate the the texcoord node properties directly for tiling, but that node can't be exposed via parameters, so the best use is to multiply the texcoord by a constant and input into the UV slot instead.
  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    So you are saying that if I want to tile two different textures, those two different textures can't be in the same map?
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    No they can be in the same map, but you would have multiple texture sample nodes to tile each channel independently. Basically instances of the same texture map.

    Under the hood it would count as a single texture sample to the sample limit, even though you have multiple texture sample nodes.
  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    is it possible to make a really quick and dirty example? I thought that's what I was doing but the texture sample node is giving me a float error. Even after rebuilding the mask into 4 vectors.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    I don't really see the point in re-building the texture with the different tiling, only reason I could think of is for organization purposes but you are just adding unnecessary instructions.


    Each texture sample is an instance of the same texture 1st being tiled twice, 2nd 3 times, and 3rd 4 times. Also different channels are being in the outputs for each sampler Red Green and Blue respectively but it can be useful if you want to use say the blue channel that tiles twice instead of 4 times by simply using the top texture sample.

    Also looking at your screenshot, you don't need to mask the values if you use the individual channel R/G/B/A outputs from texture sample nodes, you are already outputting a single channel at that point. If you have performed other operations down then line you might have to do that.
  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    ohhhh. I get it now. I guess I keep forgetting multiple texture samples doesn't actually load 4 separate textures.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    ohhhh. I get it now. I guess I keep forgetting multiple texture samples doesn't actually load 4 separate textures.
    Yup, and you can convert those samplers to parameters that have the same parameter name and you just need to change one parameter in the material instance to change them all.
  • daniellooartist
    Options
    Offline / Send Message
    daniellooartist polycounter lvl 11
    I think I got my material instance the way I want. Thanks for your help once again m4dcow :smiley:
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    I think I got my material instance the way I want. Thanks for your help once again m4dcow :smiley:
    No prob dude, glad I could help.
Sign In or Register to comment.