Lately I was “playing around” with POM (Parallay Occlusion Mapping) Materials for 3D Skidmarks for our vehicles. The POM Material works fine for Static Meshes, but when used in a Deferred Decal Actor, the Rotation has to be (0,-90,0), otherwise the Texture (Material) gets stretched and the POM effect disappears. Hard to describe how it deforms, it has no clearly recognizeable pattern, but it seems that the Parralax Occlusion assumes a different viewing angle than it actually is.
My question is what could cause this and how would I fix it. For a better understanding of the problem, here a few pictures of the Material itself and the working POM on Static Meshes and the POM on Deferred Decals, one in the default Rotation (0,-90,0), and one with modified rotation.
The working POM Decal on the Landscape, not rotated (Default Rotation is applied: 0,-90,0)
Hi, this is because the tangent space transform does not work for decals. It is possible that changing it from world-tangent to world-local may work in this case. I will give it a shot as soon as my current compile finishes.
edit so that is definitely the source of the problem but so far no combination of local transform is fixing it. Going to require some more debugging.
Passing the transform through the custom UVs did not work, seems to have just returned noise.
You need to make a blueprint for the decal actor, and you need to create an MID for the material and pass in the three local space vectors, and then the camera vector needs to be transformed into that custom vector basis. There is a material function “Transform 3x3 Matrix” that can do it based on the 3 vectors. That part would replace the Tangent Space transform inside of the POM function.
The limitation is that the coordinates of the decal will basically be planar.
Ah that was a silly mistake by me I can manually modify the appearance of the decal now, changing the vectors by hand. But the blueprint is still not working correctly, it seems it is not changing the material or maybe the parameters. I added in a value I could change by hand in the blueprint to test this, and it does indeed not change anything. I added a “set material” node to be safe, but that changed nothing. Is there some issue with decals and MIDs? Or should I do something different?
Sorry for all the questions, and thanks for your time. This will be killer for our game Squad if we can get it working!
So what was the actual outcome for this? Did you ever get it working? I’ve been randomly plugging stuff around to try to make a POM decal on landscape slopes work but not having much luck. I can get everything looking good, but not from angles lower than the decal itself.
Since we have hear a nice POM talk @RyanB are they any plans to improve the POM shaders in near future ? They are still a lot of issues/limitations especially when using the POM with silhouette sahder…
Heads up though, I did multiply my X vector by -1 to flip it (but not Y and Z), you may also have to flip vectors depending on what the rotation of your decal actor looks like inside the blueprint (my decal actor was 0,-90,0 inside the root).
And this is what my blueprint looks like, I just got this working so I didnt optimize this between construction a event instructions yet.
In this case, I am using GetActorTransform, of the decal actor (Decal Dent) inside the BP and breaking it, **GetActorRotation **also works, I just needed the full transform for other things elsewhere on my BP.