Home Unreal Engine

(UE4) Different texture cordinates plugged into mask channels texture?

polycounter lvl 10
Offline / Send Message
melviso polycounter lvl 10
Hi all,
Is there a way to tell ue4 to use a specific texture coordinate for a particular mask channel without duplicating the said texture in the material editor. Like plug in different texture coordinates  to tile different mask channel in a texture sample?

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    No.

    But you could make this with the custom node. If you really need this, I can make you the code if you want. Its just a few rows. Then it could be saved into a material function so its reusable.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Ok here you go:
    download:
    https://www.dropbox.com/sh/r1v5u4u803pv3os/AADO85nOgb5cgOEerYlzhC0Fa?dl=0
    Just extract and put it in your content folder.

    Its exposed to the library so when you right click in the material editor and type in "CoordPerChannel" it should give you the material function node.



    On the left part of the image, you can see whats inside...You don't have much to do with that though. Then on the right, there is the function. You just plug a texture object, and you can tell whats the coordinate of each channel. Result is packed back into channels so you can access them separately with a component mask or a break float node just like on my image. All coordinate inputs defaults to coordinate index 0.

    This thing could be developed further and optimized some, by first checking which coordinate inputs are different and sample based on that. Like all of the input coords are the same, just sample once. If 2 are different, sample twice using the 2 different coordinates etc. But if this is only for personal usage and not for sumething super optimized, it should be fine as it is...
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Wow, thanks a ton, Obscura. :-)
    This is just perfect. Downloaded immediately. This would make using mask channels easier. :)

  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Obscura, is there any chance you could pls make it possible to add an additional texture coordinate for the alpha channel? I did try to see if I could modify the function to do this but I got totally lost. Seriously, really grateful for the code and thanks for the help so far :).

    I have also be reading of mask texture added to the alpha channel of diffuse and normal maps. In this case an append node would have to be used to get the rgb channels and plug them to the material nodes accordingly. Is this a good method or should they be left alone.

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes, but not now. I'll make it later today, after I got home.

    About the normal map alpha channel, yes, I do that all the time because then you would set that normalmap to use default compression, and after adding the alpha, it has the same resource size as with normal map compression without an alpha.
  • Obscura
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks a ton, Obscura. You rock!! :smile:
Sign In or Register to comment.