[Bug] World Aligned Material works incorrectly (ignores scaling)

Hello there!

Quite some time ago I’ve noticed a bug in earlier versions of the engine. This has now been resolved in 4.14 as you can easily look up here:

Still the World Aligned Materials do not work as expected. I’ve created a simple example of what I mean:

What you see are two identical Static Mesh Actors with the Same Material Instance attached to them (a world aligned material) the right one has the default scale and the left one is scaled down a little on Z to make it very flat.

In version 4.12 of UE4 this worked correctly on Static Meshes and not on instanced static meshes, hence the bug report here:

but now after the recent bug fix it doesn’t work at all.

If the World Aligned Material would work correctly then the mesh on the left side should be mostly covered with grass material, as defined through material parameters. However despite changing the scaling of the left mesh the material displays no different than the right one which has a default scaling.

I thought the whole point of World Aligned Materials was it’s capability to adapt to a different scaling automatically without the need to adjust all parameters in the material itself… an ability which has now been lost completely.

I hope this Bug Report helps, I sincerely hope this can be fixed soon because it would be a very valuable asset for procedural generated content (the same mesh with different scaling creates different material surfaces).

Kind Regards,
Gull Jemon Studios

Hi GullJemon,

I apologize that the intended fix introduced a different error. Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here: Unreal Engine Issues and Bug Tracker (UE-39045)

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

As a workaround you can create an object scale node and plug the z value into the blend sharpness. This will alow some adaption based on object local scale. The issue though is that a bit of tweeking is still needed and doesn’t save you much time depending on the use case.

Cheers,

Awesome, a lot for the quick answer.
I still really appreciate all the effort that is put into this.

Hey, just getting back from the developers. This is working as intended, they explain the following:

“The blend node (world aligned blend) is a helper designed to blend across a vector comparison, typically normals against a world-space direction, and does so with the inputs provided. Scaling a mesh doesn’t alter the normals so the blending remains static. It would be up to the user to regenerate the normals correctly (either externally update the asset or taking scaling into account in the material) and then take care applying their normal map over that. This behavior can be verified by swapping to the World Normals view mode and scaling any mesh asset.”

If you would like to have a node that takes scale into account with world aligned blend you can put in a feature request. Hopefully you can modify my workaround to suit your needs.

regards,

Ah good to know… thought as much, for the info! So as I understand it is possible already to take into account the scaling but then I would need a separate material instance for each variation right? If that’s the case it wouldn’t really be procedural therefore your feature request suggestion seems very appealing… I might be inclined to try to code this on my own but I really do not understand this stuff all too much so I’d have a hard time to figure it out by myself.

By the way I just noticed: I’m actually using the nodes WorldAlignedTexture and WorldAlignedNormal… these nodes do not have any blend sharpness inputs… how do I use your workaround on them…? I hope this is not an entirely different story (I’m sorry I just now realized that you were specifically referring to the WorldAlignedBlend node and not the other ones as well) :confused: