Weird black blotches with masked material

Hey there,

So it’s probably an easy question, but I can’t figure it out for the life of me. I made broken planks and the edges of each planks have a small amount of planes which use a masked material for the broken wood effect.

But every time I bake, I get these weird black blotches that cover the area with the planes, and I just don’t get why.

The shadow and lighting settings are the default ones, so it’s really just an issue with the material. Any idea?

Check the lighting detail channel.
also, make sure the 2 items are perfectly aligned with each other.
the dark area may just be a shadow caused by an offset.

in fact they dont seem well aligned, there’s a black stop on a cusp that seems indicate an offset between the 2 panels.

Yeah, the issue is with the lighting itself. I thought it may be related with how the planes were aligned, but I tried various setups (even tried Zfighting), but the issue is still there.


Try setting the meshes to 2-sided? The blotches mainly appear a bit below each end portion of the planks, so it could be an amount of light is not getting absorbed / bounced just inside the end portion, resulting in the blotches. I also notice the lighter the plank is in the picture, the lighter the blotch…and easier to see the completely black spot such as the 4th plank where there’s a big black spot right-of-center.

Presto’s idea is good, but if that doesn’t work:

I’m no expert or anything, especially with textures, but it looks like to me that the opacity maps weren’t created correctly or the coloring of the texture is off. Could you post the opacity map, that would help some?

I’ve tried to make the mesh two-sided, honestly that made a lot of sense… but it didn’t fix the problem. Basically, the plank is made from a solid core, and the extremities are alphas on planes. With just the lighting applied, it look like this:

The opacity maps are as follow… I added the in-engine world normal map, as the normals connects flawlessly…

I also tried to remove all the alphas on the “interior” part of the plank, but that only slightly lessened the issue. Would there be a way to deactivate shadow casting but only on the alpha masks?

Try removing the normal map and see if that builds flat?

Same problem without the normal map:

Ok well, we have eliminated one thing at a time. All that’s left is your opacity mask and your model.

First of. The model.

Theres no need to have it be cut like your image shows above. Even if you plant to simulate physics on it later on, chances are you’d never notice the difference between a square mesh and a mesh with the 2 or 3 extra cuts at the tip.
So I would suggest you start with that.
cut, and re-map the UVs for one plank to be flat, so you can test it.

Second, the opacity map and the material.
assuming that the flat plank shows the same dark halo, then something must be leaking from the opacity mask into the material albedo.
how are you applying this mask to the material?
It should really just be used as an alpha over the lerp of the regular opacity and 0 (transparent area).

Last and bonus. For rendering the splintered part at the edge with the flat planks, you can use parallax on your material.
you could also fake the depth with double sided sheets that each have a different opacity mask mapped to them but that may get more expensive in the long run

Is there ambient occlusion in the scene? It could be activated in a post process volume unknowingly, and if so, could be how the blotches are showing up. Are there overlapping alphas / planes in the splintered / broken areas? It would seem inconsistent with the blotches because the geometry is so close together, but it might actually be AO via other geometry within the AO setting’s range of those planks. It’s a longshot, though, I admit.

How did the 2 planks (narrow one, and the shorter, 2nd one in the opacity map photo above) get fixed almost completely? There’s not much blotching on those.

  1. Split the mesh up into two pieces
  2. Create a new blueprint actor using Static Mesh Actor as parent
  3. Inside the blueprint set the inherited static mesh component to be the main plank mesh
  4. Inside the BP, Add another static mesh component, set it to not cast shadows
  5. Set the newly created non-shadow casting static mesh component to use your fractured mesh

Hierarchy should look something like this:

There might be a better way of doing this, but I suspect there probably isn’t. UE4 doesn’t have good support when it comes to controlling shadow casting, as I personally learned this a long time ago when I discovered that it was impossible to turn self-shadowing off, which probably also would have solved your problem.

The issue is starting to look more and more related to the mesh structure.
you should try the same item in 4.23 to see if you get the same artifacts or not.

The occlusion is not active in the scene, not from post-process nor on the lightmass settings.

I’ve been doing some tests with the meshes. The only way I managed to get rid of the issue is to keep perfectly squared planes and meshes, with no modeling chaos at all and only keeping the edges as alpha.

Here, the try with square alphas only:

So then I removed the bevel inside the plank, which looked like this:

And the final iteration, without anything at all (bare planes, square plank), works… but obviously it doesn’t look right.

So this means that it IS a mesh issue… but how can I adapt it to have an organic look without this problem?

Did you try what I posted above? Splitting the mesh into two parts and disabling shadow casting on the fracture mesh?

Honestly if I had to guess my assumption would be that you have a two fold problem:

  1. The alphas are self shadowing the rest of the plank
  2. The lighting scale is too large causing the cards and plank to shadow eachother

If I’m right then what I posted above should work.

Bump offset or world displacing the alphas might work better. Are the alphas and the main plank meshes grouped or merged (per plank only)?

@Arkiras I have the feeling that the alphas are indeed self-shadowing the planks, but the lighting scale is at 0.1 and IGI quality is up to 10. The blotches are way over the top and I started to check around the lighting threads that MostHost LA’s comments seemed to point to… I am currently downloading 4.23 to check if the issue is resolved with an older engine version. I can’t use the blueprint method as I am making this for an asset pack that will be sold on the MP…

The alphas are merged with the planks (same mesh).

Try adding planes on the inside of the plank that are not actually attached to the plank.
So long as the outer portion of the plank is perfectly square (no inside hole) I wouldn’t expect the shader to cause issues.
Because of the transparency on the top of the plank you should still be able to see the mesh within it. Hopefully without any artifact even in .24/.25

Well… I tested in 4.23.

It seems like the issue is more than just the mesh… because in 4.23, here’s how it looks like (static lighting scale is at 0.1, indirect lighting quality 10, preview quality bake):

The issue is partially still there, but just making sure all the planes are correctly placed would fix the issue.I tested it with a regular static lighting scale and the issue was there, albeit much less intense than in the 4.24 version.

The baking was done with the exact same materials as in the 4.24 version, alphas included (this is just a basic lighting screenshot).

So it’s 80% 4.24, 20% planes placement. I can fix the latter, but not the first… At least I know it’ll be fixed eventually. Until then, I just have to fix the planes and hope 4.25 has this figured out.

Not sure if you’re still having issues, but do you have distance fields enabled in the project? If so you’ll probably want to set the distance field res on the cards to 0.