Vertex Color Node Cancels out the Paint Overlay and Vice Versa. Please help!

Hi everyone on the Unreal forum.

I have just started working with Unreal 4 after my team decided to transfer our game project from Unreal 3 to Unreal 4.

So far Unreal 4 is amazing! :smiley: But of course I am having a few hiccups adjusting from U3 to U4. At present I am trying to re-create one of the main materials we were using in U3
in U4 but for some reason it doesn’t want to work. I’ll explain.

In Unreal 3 we were using an Atlas Texture for our Vehicles. The texture itself is Black and White, but we were tinting the vehicles with Vertex Color and adding coloured details and decals etc
by using a 2nd UV Layer that contained a “Paint Overlay” (Think of applying stickers on top of a painted model.)

So in Unreal 3 the Material looked like this:

And the result was that we had a vehicle with a black and white diffuse, tinted in appropriate areas with vertex colour and detailed with decals etc. It worked really great!

So I am trying to recreate this exact same Material in U4, but for some unknown reason, the exact same material set up in U4 does not create the same result sadly.

The problem is this: when I hook up the “Texture Sample Paint Overlay” to the Linear Interpolate (Lerp) B and Alpha Channel, it successfully applies the Paint Overlay to the model, but
at the same time, it cancels out the effect of the Vertex Colour. If I unplug the “Texture Sample Paint Overlay” from the Lerp, then the Vertex Color effect can once again be seen in effect.

The 2nd Texture Sample with the Paint Overlay seems to be canceling out the Vertex Colour and I have no idea why.

Heres a screen of my attempt to recreate the Material in U4:

So as far as I can tell the two materials are identical, but they are giving different results from U3 to U4.

Could anyone shed any light on this issue? I would be very grateful thanks a bunch! :smiley:

I can’t explain why it works in UE3, but it looks like you’re multiplying the vertex color before you’re interpolating between the two textures. If you want the vertex color to affect the output of both of the textures, you’ll have to multiply it after the lerp node.

Hi Electricsauce, thanks for your reply and thats a good suggestion. Possibly it could work, but the only problem with that is that I don’t want the vertex colour to effect both textures. The vertex color should only effect the diffuse.

But any ways, I’ve solved it! :smiley: And the solution was the last thing I would expect. Seems some one else was having a similar problem and asked about it before on the UE4 Answer Hub.

Heres the Q and A. Alpha blending textures in material - Rendering - Unreal Engine Forums

It turns out that the cause of the problem was Adobe Photoshop. Apparently Photoshop is noot exporting the alpha channel correctly. It is filling the alpha channel with some white information.

I notice this in my own experience when I had a strip of white colour on my Paint Over Lay Texture, and when viewing it on a model inside UE4, the white strip was being read as Alpha not as white. So effectively Photoshop had, instead of exporting a proper alpha, is exporting some kind of Alpha + White mix… very wierd. (Sorry for messy explanation)

Any ways, for me at least in this situation, is to open up the Paint Overlay Texture. PSD inside the free editing software Gimp and then export it as a Targa from Gimp. The Gimp Exported texture has correct alpha information and this solves the entire issue for me. The Diffuse + Vertex Colour with a Paint Overlay (With Alpha) now displays correctly in Unreal 4. Hurray!

Hope that all made sense. I’ll try to post some screen shots to show what im talking about later. :slight_smile:

Oh by the way… the really strange thing is, is that I never encountered this problem in Unreal Engine 3 (UDK), even though I was using textures with alpha exported from Adobe Photoshop. They worked just fune in UE3.
So it seems that UE4 is picking up on some discrepancy in Photoshops exported Alpha, which UE3 did not.

Okay so here are some screens to Clarify exactly what was going on here: cfe930e14ccdd4cd37196998979be2404577134c.jpeg

So there is a Metal Road Static Mesh with black and white diffuse, vertex color and paint overlay. Functioning correctly. This is using a Paint Overlay texture exported from Gimp as a TGA.

Here is the problem I was having previoously:

In this version there is no Vertex Color and the Paint Overlay Texture seems to have had its alpha channel mixed with white, sort of. So the result is that white areas that are NOT supposed to be transparant, end up having an alpha value. See the white lines in the middle of the road, they are partially alphaed out.

So these two objects are using exactly the same material and textures apart from one difference. In this first image the Paint Overlay texture was exported from Gimp.
In the second picture it was exported from Adobe Photoshop CS6. Only difference between them.

Hope that explains any ways. :slight_smile: