Vertex Paint With RGB and Alpha?

I have managed to set up a material that uses the separate RGB channels of the vertex colour node to blend three different textures using mesh painting, however I cannot manage to blend a fourth texture using the Alpha channel. Is this possible somehow?
I know that all four channels can be utilised in the ‘Blend weights’ mode with a 5-way blend material setup as illustrated in the documentation, but this does not quite offer me the functionally that I’m looking for. Any help would be appreciated. Thanks.

Hey Matt_Cooke -

Have you taken at a look at this docs page:

https://docs.unrealengine.com/latest/INT/Engine/UI/LevelEditor/Modes/MeshPaintMode/VertexColor/MaterialSetup/4Way/index.html

This setup does work I just tested it. The hard thing to remember is that the Black and White colors in painting view are your Alpha and it is your “base” texture.

Hope this helps, if there is still confusion please comment and I will get back to you -

Eric Ketchum

Thanks Eric,
Yes I have tried this network, however, it only gives me three textures, plus the base texture. That’s correct right. or am I missing something? What I am looking for is four textures plus the base texture.
Many thanks.
Matt

Like this:

https://docs.unrealengine.com/latest/INT/Engine/UI/LevelEditor/Modes/MeshPaintMode/VertexColor/MaterialSetup/5Way/index.html

Can you describe how you want the vertex painting to function? Be specific and I will see what I can do.

Thank You

Eric Ketchum

Hi Eric, Thanks for getting back to me on this.
Yes, the 5 way set up is almost what I’m looking for, but not quite, as it only seems to work in the blend weights mode and not the colors mode of the mesh paint tool.
What I am hoping to achieve is this:
My material has a base texture (in this case cobblestones)
With the Red channel of the vertex colour node I can paint a texture (eg. Moss)
With the Green channel I can paint another texture (eg. Mud)
and with the Blue channel and Alpha channel combined I want to paint two different textures or vector parameters that together give me a darkening due to water and on top of that a fully reflective wetness.
I’m not sure how clear that was, as it’s tricky to explain - sorry!
But basically I’m wanting the blend weights functionality (ie. four distinct texture channels to paint with), but within the colors mode of the MeshPaint tool, which allows me to paint either texture independently, are multiple channels at the same time.
Many thanks,
Matt

Try this setup:

You are using color not weight blend here to do the LERP control so start off by setting all vertexes to BLACK (no Value which should be the base Cobblestone)

Thank You

Eric Ketchum

I am seemingly unable to paint with two channels simultaneously in the blend weights mode, eg., R&G, or B&A, etc., or am I missing a trick here? I basically want the ability to use four different textures in addition to the base texture (like you can in blend weights mode), but with the multiple simultaneous channel functionality that the color mode offers, but for some reason, I am unable to use the alpha channel to paint like I can with the R,G and B channels…

Why does “blend weights mode” not work for you? What is it you cannot do with those nodes?

Thanks Eric. I’m trying this out at the moment. But is it possible to utilize the alpha channel in this set-up in the same way that you are using the R,G and B to add one more texture? I can’t seem to get that to work, which is the essence of my problem.

I believe that in “blend weights mode” the end blend is normalized to 1, but it can include more than one texture channel. I believe the formula for “blend weights mode” is “First take the sum of the color+alpha, and if it’s greater than 1, divide down to 1. Then if the sum is less than 1, let the base map through for what remains.”
So, you could paint a little bit of all channels, and you’d get a mix of all the channels, including the base channel as long as the sum of what’s painted is < 1.

Thanks jwatte,
I’m not entirely sure how to implement what you suggest. Are there any specific steps that you can describe?
Thanks

I still don’t undestand how the “blend weight” setup in the documentation doesn’t give you what you want. You should be able to paint 25% red, 25% alpha, and then get 50% base, 25% red-layer, and 25% alpha-layer.
I’m not at the editor right now so I can’t model it out myself though.

Thanks for your help jwatte, unfortunately I can’t get it to work quite how I want just yet, but that may be due to a material set-up error on my part, I’m not quite sure yet. I guess I will just have to spend a little for time experimenting with it.

Okay, so I’ve spent a bit of time pondering your answer and I have figured it out, I think…
I did not realize that I needed to use the colours from the ‘colour menu’ in conjunction with the ‘blend weights’ menu. In a way, I wish the two features were unified within the same tab, or that the blend weights menu had a colour palate of its own - not very intuitive.
Anyway, thanks for helping me out. I appreciate it!

Hi Eric,
Thanks for all of your help with this matter. I think that I am closer to achieving the Vertex paint set up that I am aiming for, however, I have a couple of follow up questions if you don’t mind?
Firstly, do you know how I can go about setting up my normal maps in the 5Way colour blend setup in a way that allows me to add them to one another rather than simply Lerp? I had this working on my original material, but can’t quite figure it out with the 5Way colourblend set up.
Secondly, I am getting a pretty strange result when looking at the mesh via the RGB view in the mesh paint tool? Any idea what might be causing this?
I’ve included a grab of my vertex colour setup too (as I’m not just simply using the vertex color node by itself), as it could be the cause of the problem?
As you may recall, I’m also having issues with the various frame buffers within this project, so might the issues be related? Detailed Lighting Buffer plus others not working - Rendering - Unreal Engine Forums
Thanks for all the help.
Matt

I managed to figure out a solution with regards to adding the Normal maps together in the 5-Way colour blend set-up. If anyone requests it I will post a picture of the network. I’m still baffled by the strange rendering of the RGB channel in the Mesh paint tool though.