Download

POM Decal issue

Hi

Do I have to do anything special to have POM working fine on decals placed on angled surfaces?

On flat cube looks fine:

Cube slightly rotated towards camera:

No pom:

Pom:

I had this issue before with meshes and problem there was my mesh UVs. But this time it’s decals and I don’t find anything I’m doing wrong.
(Reference plane only moves the problem up and down).

From what I’ve seen, this seems to be an unfortunate limitation of the way decals work. It seems to be essentially the same issue that prevents decals from inheriting the normals from underlying geometry generally: decals can overwrite the underlying normals (throwing away or averaging with the original value), but can’t “affect” them. POM needs access to correct vertex normals in order to work properly, so I haven’t been able to find a way around this issue.

On a (mostly) unrelated note, it seems like decals don’t support WPO for modifying the underlying vertices either, which isn’t that surprising, but it’s interesting that the WPO output pin even shows up on a decal material. Maybe it was just left on by accident, since I haven’t been able to find a use case for it yet (or even evidence that it does anything at all).

I don’t think it’s a limitation of how decals work though. As an artist I don’t know how decals work in depth under the hood, but I think if decals work fine in other engine almost at any angle, then something’s wrong with decals in ue4 to be specific.
Here’s a pom decal on a slope in cryengine and I’m seeing zero artifacts like what I’ve posted in the post above. Not even when viewed from a completely 90 degree angle.

And this view angle is way more extreme, still zero artifacts apart from slightly seeing the steps.

Would be really cool to have pom working properly for decals in ue4. There’s so much that can be done with it.

Would be cool indeed. POM/Pixel Perfect Displacement with silhouette clipping on tiled maps, SVOGI, Ocean…blabla.
Sometimes it almost makes me miss CryEngine :smiley:

For ordinary decals you could try modifying POM material function to take Vector3 input instead of using Vertex Normal WS. Then switch your material function to use world space coordinates, and feed that newly created input with Scene texture World Normal. Now POM skew will depend on how flat the surface beneath is. You might also need something to account for decal transform, if you are not using world space UVs, but tracing in world space. In Theory it should be possible to adjust POM tracer to account for stretch, but I haven’t tried it. Obviously it works only for more or less top down decals. Sideways decals would require some shuffle and separate material. Material, that dynamically switches projection would be too expensive.

If you want to trace simply in decal space, then you would probably need to account for decal actor transform.
For D-Buffer decals, there seems to be no remedy sadly.

How use this decal on walls?

May i ask…and this a bit off topic, but why not using tessellation? POM is great but as far as I have noticed it takes some effort to get to the tess. level. While tess is real geometry with all pros and cons.

because tessellation cripples the performance. the base cost is way too high even if the tessellation multiplier is set to 0.0
not to mention other issues like tessellation + foliage + LODs being completely broken since UE4 4.7

in any case how would a decal affect the tesselation/displacement under it? never tried this but I doubt this would work

Decals in other engines affect displacement. In UE4 they do nothing and underlaying displacement bleeds through the decal i.e if you put a flat concrete decal on a displaced brick wall you will have the brick displacement bleeding through the flat concrete decal. This basically means you have to choose between using landscape tessellation without using any decals or turning off landscape tessellation for good so you’d be able to place decals here and there. And this is intended behavior as the docs say. Really astonishing.

right, I remember your pictures now where your tessellated landscape was showing through your road decal :eek:

3 years later, any update if they still work? I have flat asphalt road texture and putting a speed breaker decal on top which lo and behold, does not pop out in displacement resulting in a speed breaker that is flat…which you know…defeats the purpose of a speed breaker lol.

Well, for your speed breaker a decal offers no collision either, so is it really the best way to place a speed bump in the way?

Regardless, the 2020 answer is to use the new landscape RTV functionality (real time virtual texture).
there is a new procedural way to actually displace tessellated geometry with placing a mesh and rendering it in the RTV that should provide better visual final results while lowering the overall cost of the rendering - possibly.
As almost anything it is very situational, so it may be better or it may be worse depending on the level setup and what its used on.

That said, apparently in 2020 the docs for POM have disappeared. One of the many mysteries of this year I suppose.
there should be a few pom examples in the content example project. I remember seeing them, and they were explained rather well.

that said, you can’t expect POM to work at near parallel angles. It isn’t actually distorted geometry but light trickery. In your image i would never expect the bump to show as extruding from the floor…