Jump to content

How to fix Landscape Terrain not showing Albedo on Intel Graphics Card


photo

Recommended Posts

Posted (edited)

I had this problem with my Intel iris xe, im not sure but it can also appear in other intel gpus, since they share similar drivers, and i was very worried since terrain is the main part of a scene, and it's features looked so cool and i wanted to use it.
But by default, the terrain looks completely black, dosen't matter you paint albedo or set it from a tileset.

I was getting the height and the normals, but not albedo, and also masks don't work.


So, the problem is in the landscape map's material shader. That shader is usually in the "C:\Users\<YourUserName>\AppData\Local\unigine\browser\sdks\<sdk_version>\data\core\materials\base\objects\landscape\map\" folder, named as landscape_map.basemat.
I don't know much about shaders, but still you can know with basic checkup, that height is using normal rw_texture, and albedo and mask usage rw_atomic_texture,
the only thing you have to do is to replace them with normal rw_texture function, and that fixes it.

To change the shader for an existing project, follow the instructions by the dev here- 

Copy the the landscape map mat from the sdk files, and paste with it's folder structure in your data folder.

First you have to change the INIT_RW_ATOMIC_TEXTURE_R32U above the file to INIT_RW_TEXTURE_R32U, you can batch rename using find and replace feature in the text editors, then for the albedo_in and masks_in vars, you have to change TEXTURE_RW_ATOMIC_LOAD_R32U to TEXTURE_RW_LOAD_R32U, then  for the final write lines for the albedo and masks block, change TEXTURE_RW_ATOMIC_EXCHANGE_R32U to TEXTURE_RW_STORE_R32U (just follow the way it is being done for TEX_HEIGHT).
After you do it, load your project in the editor, let it read the modified file, then press F7 or give "materials_reload" command to the console, and it should work after that, if it dosen't, you should clear all the suspicious caches from the data folder!
image.thumb.png.66d1dcbbf20488c2032ab720a920862d.png
If it works for you, then you can also modify the main engine's mat file, so that it works for every other new project you create, but keep a backup of the original, just for safety.

As much as i know from cpp, with my little knowledge of multithreadding, that atomics only lets one process read/write a variable at a time. It is used for safety, it might be used for the terrain to make multiple landscape map's blend. 
I don't know why it dosen't work on intel graphics card, or maybe it works for the other arc gpus and only dosen't work for iris, but i think this issue should be fixed and not ignored, but as a temporary fix, you can use this trick and get working until it happens. I haven't tested yet, but you might have some issues with blending etc, but it is much better to atleast have it working with a few bugs then not working with it at all 🙂.

I hope you find it helpful, i have also attached the modified landscape material, so you can get up and running fast if you are in the same version, or you can use the guide above.

Dhanyavad!

landscape_map.basemat

Edited by Umang.Raj
  • Like 2
Posted

Umang.Raj

Good finding, thanks for sharing with us.

Atomics were added to fix AMD RDNA2 bugs (back in 2022), so there is chance that LandscapeTerrain would not work on some AMD cards 🙂 We would need more time to find a proper fix for all vendors. 

There is always a chance that drivers were improved since that time and we can remove some old workarounds.

Thank you!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

×
×
  • Create New...