Blurry Textures in the material of Landscape

Hi everyone, i have a problem with the textures of the Landscape. I did a Master Material for the Landscape with 2 layers, so, in the second layer the base color texture its failing and shows like a texture of PS1, so blurry and the brush paints by quads, what can i do?

I tried to improve the “r.streaming.poolsize 4000” and also put the source sampler of the texture sample to “Shared:Wrap”, and the texture keeps showing blurry. Could anyone help me, please?


Hey there @Rafa_EsYu1712! Welcome to the community! I see you’re using the default TexCoords UV node. Give it a try replacing it with a LandscapeLayerCoords node and adjust it for your needs. Does this mitigate the issue?

1 Like

Hello, First of all thank you for your response, actually it changed something and improved a little bit, but it keeps going showing a little bit weird, or maybe the landscape has not enough polys… It supossed to be like this?

If your landscape resolution is too low, it could definitely cause issues like this. Try using the same landscape material on another, much higher resolution landscape and that would verify that hypothesis one way or another.

1 Like

This is a big topic. Are you using Runtime Virtual Textures? Are you using streaming virtual textures with your landscape? The fact that you’re using virtual textures would indicate you’re not using either RVT or SVT and this is why you’re getting blurry textures. Your framerate is likely to suffer greatly as well.

AFAIK, virtual textures don’t work in the main render pass for landscapes. I know with 100% certainty they don’t work with RVT. Without RVT, I don’t think it works either, but not as certain.

Let us know if you’re using RVT and/or SVT.

2 Likes

Hi, if you paint on the landscape, you have a default precision of one pixel per square meter. If you need a smoother transition, you can use a height blend with a texture, to get more detail (I think you set it somewhere in the layer info, not at my PC right now, then you will get an additional height input in the landscape layer blend).

1 Like

(post deleted by author)

Hi, yes, when this happened I found the height blending for the landscape and I will do it meanwhile I try to fix the blurry texture. Thank you for the advice!

Yes, actually I am using the virtual textures because I need it for do UDIMs. So, wich is the best way to use it and remove the blurry textures on the landscape?. Once again, thank you for your response.

Ah… I’m not sure how you would go about making UDIM’s work with landscape. To be VERY specific, you are using UDIM with landscape? If you’re using UDIM elsewhere, but not on landscape, that’s perfectly fine, but you’d need a proper RVT setup..

I’ll try to explain how landscapes work. I’m not a top expert, but I think I grasp most of this. So if I get anything wrong, others are free to correct me.

So for this part, I’ll explain how to set up RVT in case you want to use it and you’re not using UDIM or virtual textures for landscape. Otherwise, if you ARE using UDIM with landscape, skip below to the part about LOD.

*** RVT ***

What is RVT? This is basically a sparse virtual texture. If you know what clip-mapping is, this is similar to that. So you have a special virtual texture that usually holds different textures in each channel (diffuse, roughness, etc.). As you move around, the engine will ask your material to render a specific area or tile. You will need to store this in the RVT via the RVT output node. If it needs it again, it will ask your material again, but it will let you know it’s already available in the RVT. As you move around, it will discard some tiles from the RVT so if you come back, you will need to re-render it from the source textures (these cannot be virtual). You set up RVT with an RVT volume asset in your outliner. There’s one for diffuse (and associated textures) and one for height.

Now, how do you tell in your landscape material if you need to render from the source textures or if you can just grab it from the RVT? There’s a node called “VirtualTextureFeatureSwitch”. The No input comes from the original non-virtual textures and you also write this info out to the “Runtime Virtual Texture Output” node. On the Yes input, you can grab the materials directly from the RVT node. If you have masked out part of the landscape, you can use the Landscape Visibility Mask node to your Opacity Mask attribute.

And that’s basically it. A request comes in. If VTFS says No, it’ll grab it from the original textures and you also write it to the RVT output node. If VTFS says Yes, you grab it from the RVT node.

Now, RVT doesn’t work with virtual textures when VTFS says No. In fact, I get an error in UE 5.6 if I try to use a virtual texture with RVT. In past versions, it would let you do it, but you often got blurry textures.

Why?

Suppose the engine asks for the super high precision tile that’s directly in front of you. So far, so good. You do a texture sample from your virtual texture and off you go. But wait… what did you actually read from the virtual texture? If this is the first time reading from it, you will get the coarsest tile because the engine hasn’t had time yet to load in the higher detailed tiles. Virtual textures work this way. They go from coarsest to finest in that order. You have no control over what LOD it will give you. This is often seen as texture popping. It’s usually not a big problem because every frame, the engine will ask for that same tile and it’ll get better and better as the engine loads higher LOD tiles from disk.

But with RVT, it CACHES the initial tile it obtained from the virtual texture. And that’s usually the coarsest tile. So it stays blurry until that tile gets cycled out of the RVT. This is why after a while, the textures look fine as the engine asks you to regenerate those tiles it has flushed out. Zooming out and in helps. But if you just rotate the camera, it won’t get better and you’re screwed.

In your case, it seems you’re just rendering every time. Since there’s limited memory, you’re likely never going to get as nice a render as you would with a proper setup of RVT. So that’s one cause of blurriness. You can still get the same issue though even without RVT, but I want to finish off explaining RVT setup first.

Now, RVT has a drawback. If you look at the horizon, it’s going to need the coarser LOD’s since those are far away. But coarser LOD’s require EVERYTHING to render since it covers such a huge area. These are insanely slow to render. This is where SVT comes in (Streaming Texture property on the RVT volume). You can precompute the coarsest N LOD levels. Usually 4 to 6 is enough. This is why there’s a “Build” button. It is SLOOOOOOOW. But once built, it will always be available at runtime and this will help with performance on those coarser tiles.

*** LOD ***

Now, back to your case. You’re NOT using RVT because I don’t see you writing to the RVT output node. So why is it blurry? Well, even though you’re not using RVT, the engine still requests the exact same tiles. So if you’re using virtual textures, the engine will start by asking the tile directly in front of the camera with a high LOD. But your virtual textures still operate the way any virtual texture does and will load the coarser ones first. I don’t know what the engine does here because I don’t use landscape this way. Ideally, texture precision should get better every frame, but it’s possible the landscape LOD and your virtual texture LOD aren’t in sync. So you can play with LOD Distribution properties on your landscape actor. This is something you need to tweak even with RVT.

*** POOL SIZE ***

Ok. So that’s the main engine system. There’s ANOTHER reason why the textures could be blurry.

In the console textbox in the editor, type the following:

r.VT.Residency.Show 1

Some graphs should pop up.

In your project settings, go to Engine/Virtual Texture Pool. If you already have settings here that you’ve set up earlier, write them down or take screenshots or something because we need to remove everything. Set your default size in Megabytes to at least 256MB. Check “Pool Auto Grow In Editor” (this must be ON). And delete everything under fixed pools and transient pools.

Now back in the editor, move your camera around. Turn the camera everywhere you can, not just the land. What you want to keep an eye on are the red lines in the graphs. If any of them go to the top or you see the view resetting and the pool size grow, then your pool sizes are too small. Keep moving the camera around until the red bar no longer resets your view and no longer reaches the top.

Then go back to the same place in your project settings and copy the transient pool settings to the fixed pool settings copying the info EXACTLY in the exact same order for the formats and round up the Size In Megabytes for each entry to a power of 2. You only need to copy the size and format properties. Now uncheck “Pool Auto Grow In Editor”. And delete the transient pool completely.

Your textures should now look a LOT better.

3 Likes

Just thought of something else. If you have problems with virtual textures looking blurry in general, you can try increasing the tile size in your project settings under Engine/Rendering → Virtual Textures → Tile size. Normally, this wouldn’t matter, but it does start to matter on large areas such as landscapes.

I found that enabling Anisotropic filtering is also very good. Requires a bit more memory for textures, but what this does is help with textures seen at an angle. Walls would be the exact opposite since it is flat on the view. But landscapes are very prone to being viewed at an angle.

If you’re not using RVT, I think you need to set “Draw in Main Pass” to “From Virtual Texture”. Make sure you have no RVT volume in the scene. I’m not sure on this one, but thought I’d mention it.

2 Likes

Hi, thankyou so much for sharing your advanced knowledge about the engine and help me.

I’m only using UDIMs for a couple of models for now, but I don’t plan on using UDIMs for the landscape either, as I don’t know how to use it or what it’s used for…

I have several questions about everything you’ve said. For example, I have the material configuration I showed above and I want to integrate the Runtime Virtual Texture Output node. How could I apply it to the various landscape material layers? I can only have one Runtime Virtual Texture Output node.

Another question is, I understand what you’re saying about the Virtual Texture Feature Switch node, but what do I connect to that “Yes” and that “No”? Also, do I really think all my textures are virtual? Since, when I activate virtual textures in the project settings, they are all virtual textures, since a “VT” is shown in the texture preview, or I don’t know, maybe it’s my ignorance…


Regarding the LODs, how could I configure them correctly and sync them with the virtual textures?

And regarding the latter, I don’t see any red line rising at any time.

Greetings

You don’t. You apply the blended output. There’s no need to continuously reblend everything. Once it’s in the RVT, you just sample from it directly.

So in your case, you have a node “Landscape Layer Blend”. Connect it to a “GetMaterialAttributes” node and add the attributes you use. In my project, I’m using BaseColor, Specular, Roughness, Normal, Displacement and Opacity Mask. Your RVT texture needs to be set up to support all that. It’s the “Virtual texture content” field on your RVT.

From the get node, there’s a material pin you can pass through to your Landscape material output. And individual pins you can use to write to the Runtime Virtual Texture Output node.

This sets up the ability to write to the RVT texture.

Right, so everything we’ve described above is for the “No” pin of the Virtual Texture Feature Switch" node. And on the yes side, you just sample from the RVT.

Probably better to give you an example. I’ll only show the part you’re missing since I do some weird stuff with height maps.

So everything you have would be at the top of my screenshot up to the LandscapeLayerBlend and writing to the RVT Output. For the RVT sampling, you can use either RVT Sample or RVT Sample Param. The Param one lets you create Material instances that use a different RVT. Useful if you have multiple levels.

If it has a VT symbol in the texture preview, you CANNOT use it in a landscape material. You WILL get blurry textures. If you say that when you enable virtual textures in the project settings, they instantly show VT, I think they are already VT to begin with and when you turn off virtual texture in the project settings, it just can’t use that feature anymore and treats it like a regular texture.

So you need to convert those texture you use for your landscape to regular textures. You just right click on it and select “convert VT to regular texture”.

It’s also possible you have “Enable virtual texture on texture import” checked in your project settings. This could explain why everything is a virtual texture.

Another important setting is “Auto Virtual Texturing Size”. If this is a small value, then everything you import will turn into a virtual texture even when the setting in the previous paragraph is off.

Once you convert your textures, your material will likely complain that the sampling type is incompatible. You’ll need to change the sampling types to not be virtual. Instead of Virtual Color, just use Color.

This is just eyeballing it. You have several properties on the landscape you can adjust. They are located under the “LOD Distribution” section of your landscape actor. You will have “LOD 0 Screen Size”, “LOD 0” and “Other LODs”. These tend to depend on how you use your UVs. So I can’t really go over this. But it’s not too difficult to see their effects.

The red line is in the view itself as an overlay when you type “r.VT.Residency.Show 1” in the console. Then you’ll get something like this:

The red lines in the graphs show the pool usage. Note that most of this will not come from your landscape. It will come from your other assets in the world. Why does this affect your landscape? Because there is limited resources. If other assets take up too much memory, then everything will start to use lower LODs, including your landscape, in order to save memory and keep your game running.

Hope this helps.

2 Likes

Hi, thanks for your support.
I just set up the landscape material as you instructed, however, the material now looks like this:



And I converted all the RVT Textures of the landscape to regular.

About the red lines, i cannot see nothing, i think that it is because i dont have so much things on the environment.

In your RVT node (the green one), make sure you set the RVT texture for your terrain. And try setting the “Mip Value Mode” to Default. If you don’t use masking (holes) on your landscape, you can remove the Landscape Visibility Mask node.

I’d like to see a screenshot of your terrain RVT texture settings. You need to select a “Virtual Texture Content” that can store what you’re suing. If you’re not using masking, I think this one is good:

YCoCg Base Color, Normal, Roughness, Specular is good enough.

Let’s try to get a proper output first before changing the other settings.

On your Landscape, set “Draw in Main Pass” to Always.

Also, the bounds must be set correctly on your RVT terrain actor. This thing is really buggy to set up, but you only have to do it once. Under Volume Bounds, select your landscape. Then click on Set Bounds. For me, doing both in the same session doesn’t always work. I tend to set the landscape. Shut the editor down and restart it. Then I click Set Bounds button and it usually works. Snap to Landscape should be on as well I think.

If you can confirm these things and it still doesn’t work, we’ll try to see what else could be going on.

edit: Oh, and it seems your texture pools are fine for the time being.

Hello, thank you for all.

And i setted the bounds properly and adjust those things that you told me, and at least, for now, look like this… not black

The landscape is showing weird shadows.

And I dont have nothing in “Streaming Texture”, maybe is because of that?

Greetings and thank you so much for your help!

Streaming texture only affect far away tiles and you need to have the main RVT working before generating those. Everything should be working. Could you check on your landscape asset that under the Virtual Texture section under “Draw in Virtual Textures” that you have your RVT texture listed? If it’s not there, add it. That’s where you create the volume, so I can’t imagine that it isn’t there, but I’m running out of ideas.

If you bypass the VirtualTextureFeatureSwitch node in your material and connect the layer blend directly to the material output, does it still work? If so, it should work with RVT. So it would have to be something to do with either writing or reading from RVT.

Also, you DO have “Enable Virtual Texture Support” turned on in your project settings, correct? I thought I’d mention it because you toggled it on and off earlier.

In the RVT param node, I already asked that the Virtual Texture is set correctly, but also verify the “Virtual Texture Content” matches that of the texture. Especially if it’s YCoCg or not.

This is a little baffling because whatever you write to the RVT output node should be available to read via the RVT param node without having to modify the UVs or LOD.

edit: Oh, there’s another thing. RVT caches data. So if you change anything, you’ll want to regenerate it. You can create a dummy material where you just output a constant color and assign it to your landscape then switch it back.

If you want to be sure to completely erase the contents of your RVT, you can use a material like this:

Ensure the RVT param node has your RVT texture assigned to it.

Then switch it back to your original landscape material and you should see it be regenerated.

Well, it was just that I hadn’t included the RVT in the “Draw in Virtual Textures” array, :sweat_smile: but now it’s the same as before and even more blurry.

Because before, only the painted material in the landscape was blurry, but the texture was visible at a good resolution, now the texture resolution has worsened. The first image is how it looks now, and the second image is how it looked before:

Thank you and greetings!

Here’s a DDS file you can import. Go in the texture and change it to a regular DXT or BC texture. I think it imports it as a ‘normal’ texture. Also in MipGenSettnigs, set it to “Leave Existing Mips”.

Before trying that, try setting your tile size to 1024 in your RVT. It looks like you’re really really close.

About the height, are you saying you don’t have enough resolution on your landscape mesh? The polygons themselves? If you want more details, you can increase the landscape component resolution or whatever setting you have for your landscape. There’s also a Virtual Height Field Mesh. But this thing has a lot of issues. You can’t do proper collisions with it. So if you’re walking on it, it’s not gonna do what you want. But it looks really cool. And you can use a Height RVT with it.

So I don’t know what would be the best option for a height map when looking at mesh detail.

Thank you for your help. Doing the check you mentioned is getting complicated because I downloaded the texture you sent me, copied it, and pasted it into the “Content” folder just as you told me, and when I open the editor, the asset doesn’t appear in the folder.

Regarding the landscape, I simply want to make a fairly large arctic landscape, imported from Gaea, which is an external landscape software, import as a heightmap and add my own textures ready to put into a game, without having resolution issues or such…

What would be the grid, resolution, or settings when creating the landscape to achieve what I want?

This RVT thing is interesting, since I imagine it will be more optimized and also allows you to do things like height blending textures with objects you place on the landscape.

Thanks and best regards!