I’m making a scene that requires very high resolution texture maps. To do this, I’m using a material function to stitch multiple textures together, remapping them to 0-1 UVs. This works, but my issue is when I start applying parallax mapping using the BumpOffset function. My material function takes two textures and a UV mapping, and stitches them into a single texture across the X axis:
As you can see from the previews, this works, but it produces problems when used twice in succession, as is necessary for heightmaps:
Note the error - reentrant expression. As far as I understand it, this means there is some kind of expression that feeds back into itself, and may not terminate, but this graph is essentially two function calls. Assuming both of those terminate (which they must), two calls to it must also terminate (a standard, provable logic identity).
Could someone tell me why I can’t use this function twice like this? What is the problem, and why does Unreal seem to think this could possibly not terminate?