Bug? Runtime Virtual Texture World Height Broken for Landscapes?

Hey there! I am currently investigating how the new runtime virtual texture type “World Height” works. The regular virtual textures work like a charm, but the “World Height” one seems to have issues. Outputting world height from a static mesh via the “Runtime Virtual Texture Output” node works great, but not for landscapes. It also does not work if the landscape is using the material domain “Virtual Texture” and not the “Runtime Virtual Texture Output” node. It seems like landscapes cannot write to the height data of the FP16 world height virtual texture at all. Even outputting a constant value to the virtual texture from a landscape results in some strange and utterly broken numeric values inside the virtual texture. It seems like the texture contains some random memory value at every pixel.

Is this a known issue?

EDIT: It seems like outputting a constant value from the landscape material to the world height actually does work, but you have to offset it by 98303, which is probably due to the FP16 packing in PackWorldHeight()? On top of that, it seems like Absolute World Position (MaterialParameters.AbsoluteWorldPosition.z) does not contain a valid value for landscapes in the virtual texture rendering pass, thus it seems to be impossible to output proper height values for landscapes. However, absolute world position X and Y seem to work. As far as I know, the landscape vertices are offset in the vertex shader after sampling the normal height texture for the landscape. Could it be that this is not executed in the virtual texture rendering pass for landscapes? That could explain why it is so off.

EDIT 2: It seems to be two different problems, actually:

  1. Writing a constant world height of 0 (or 100, or whatever) from a landscape does not result in 0 (or 100, or whatever) in the virtual texture
  2. AbsoluteWorldPosition.z is not functional for landscapes in the virtual texture pass

EDIT 3: It turned out that writing a constant value to the height virtual texture inside a landscape does work, but I was not able to verify it, as the virtual texture did not update.

However, I was able to confirm that AbsoluteWorldPosition.z really is not functional for the virtual texture pass. It always returns the Z value of the landscape actors location. From my understanding, the landscape mesh is really just flat and then the vertices are transformed at runtime after sampling the normal-height texture for it. This does not seem to happen when rendering to the virtual texture. The landscape is just plain out flat.

Ugh.

I’m also trying to figure this out to blend props to the landscape, I’m able to blend to the ground no problem but it doesn’t work at diferent elevations, the world height VT looks flat gray in the preview and I have no idea how to debug further to try to figure it out.

Have you gotten any farther with this?

I am using the free Quixel Goddess map from the marketplace which is meant to be a learning aid for RVT, but I have the same issue as you are describing with VT world height - it only works on the map for a specific fixed height, and does not update based on the landscape height - is this still an issue???

Hey all,
I am experiencing the same issue described above. Has anyone made any progress on it?

Edit: I have seen plenty of videos at this point of people setting this up and blending assets on flat landscapes. Has anyone successfully set up, or even seen a video, of the height blending working properly on a landscape that has been sculpted (not flat?) Thanks!

Edit 2: I found the issue that was keeping it from working for me, I have two separate Runtime Virtual Texture assets (one for my material and one for height). In my details of my landscape I had only added the material one to the array “Render to Virtual Textures”. After adding the one for height it seems to be working fine.

Hope that helps someone!

3 Likes

@GammaM1nus that was it, thank you!

Coming back to RVT years later with more experience,
I did the same thing, using the master material from the godess scene, having the same problem, and it not being fixed by ensuring the landscape mesh details pannel had both height and texture in the material 0 and 1 slot .

now i look at it and instantly go… why… in the landscape master material that outputs the height to the RVT height… there’s a (multiply by a “parameter collection” node which is set to 120)… and is then clamped to 1 (saturation node)

in other words the Landscape Master material of the goddess scene blows out your height values to just be flat 1…
just delete that section and plug it straight into the RVT height output,

you’ll see that nice gradient thumbnail of a height RVT in the content browser again.

1 Like