How can i use RVT runtime virtual texture in world composition

How can i use RVT runtime virtual texture in world composition

thank in advice

My first try imply:

  1. Create one master landscape material
  2. Apply different instances of this material to each individual landcape
  3. Create 1 RVT per world
  4. Add 1 Runtime virtual texture volum (RVTV) to each level

Now it’s working… my problem now is that loading a level with a RVTV will induce a big spike in latency 40 to 60ms frame…resulting in a freeeze.

I’m going to try on 4.25 now.

Hey!

Did you manage to get this to work in 4.25? I can’t seem to get the Runtime Virtual Texture Sample Parameter to change between RVTs so at the moment I need to run an actual material on each tile of the landscape, rather than instances of one master material.

it really works - just apply the RVT on the detail for every landscape proxy - (( I can’t seem to get the Runtime Virtual Texture Sample Parameter to change between RVTs)) – use only one RVT - u don’t need to change it - just apply the same rvt on the landscape proxys and on the material

for now yes — and i didn’t figure out -yet - how to use more than 1 RVT – if u managed to get more than one RVTv - u can tell me — because the method mentioned by Mighty_Maax – didnt work for me ---- im now using 4.25

Ok! Yeah, I’ll keep digging around for this. It would be ideal to be able to use a RVT Sample Parameter and swap RVTs for every tile. Feels like the size of the RVT is going to be astronimical to keep any resolution on vast landscapes.

So you are using only one RVT Volume as well to cover all of the tiles?

yeah - i guess there is a way but we didnt figure it out yet - if i make it work – ill post reply here

Set the runtime texture volume in the persistent level, set the base landscape that all landscape proxies are connected to as the landscape for the volume then click set bounds. When landscape proxies are loaded in/loaded out it should adjust the runtime texture volume bounds without the lag when loading them in. Its working for me so far anyway.

1 Like

UE 5.5 and looks like problem is still there.

On C++ side I can set a parameter:
DynMat->SetRuntimeVirtualTextureParameterValue(“RVTRead”, RVT);

But looks like it is ignored in material itself.

Runtime Virtual Texture Sample Parameter needs to set Virtual Texture property (let’s say it could be default value), but only that value is used.
Value set in SetRuntimeVirtualTextureParameterValue seems to be ignored.

I looked into code and setting parameter side seems ok.
Also DynMat->RuntimeVirtualTextureParameterValues[0].ParameterValue.GetName() shows that parameter was set correctly.
I guess there is something wrong on material getter side.
I noticed that this parameter is not listed on material parameter list (like other parameters).

But when I create instance of that material - RVTRead is listed there:

Seems to be bug in material compiler that ignores that parameter

I would like to implement code that dynamically creates RVT and use it in material - but it seems impossible because of that bug.
For statically created RVT it can be workarounded by compiling separate material for each RVT, but for dynamic RVT I have no idea.

bug

Ok, I found working workaround.

  1. Create Material that use Runtime Virtual Texture Sample Param
  2. Create blueprint Material_Instance for this material
  3. Instead using Material - use Material_Instance as interface source

/Game/land/RVTHeightReader_Inst points to blueprint material instance in game assets

	UMaterialInterface* Material = LoadObject<UMaterialInterface>(nullptr, TEXT("/Game/land/RVTHeightReader_Inst"));

UMaterialInstanceDynamic* DynMat = UMaterialInstanceDynamic::Create(Material, nullptr);
  1. right now setting RVT works:
	DynMat->SetRuntimeVirtualTextureParameterValue("RVTRead", RVT);