Jump to content

[SOLVED] Can't compile "terrain_global_base"


photo

Recommended Posts

Hi,

I am currently facing an issue with an arbitrary generated terrain that is partially displayed at runtime.

This project, using plugins CIGI and Vive, contains 2 worlds:

  • One georeferenced terrain, first created
  • One arbitrary terrain, later added

Both world share some common objects, e.g. cloud, vegetation.
But in order to avoid risks when generating terrains, data directory contains (among other stuff):

  • aTerrainMontain
    • generated -> directory containing all files from terrain generator
    • aTerrainMontain.landscape
    • Landscape_array_{alb,h,n}.dds
  • gTerrainMAR
    • generated
    • gTerrainMAR.landscape
    • Landscape_array_{alb,h,n}.dds
  • aTerrainMontain.world -> refs to correct Landscape_array_xxx
  • gTerrainMAR.world -> refs to correct Landscape_array_xxx
  • [...]

Only the world aTerrainMontain encounters an issue when starting, see attached log file: 

Failed to compile evaluate shader: core/shaders/terrain_global/tessellation/heig
hts.eval
Compilation log:
        (2937,18-96): error X4580: Output variable main contains a system-interp
reted value (SV_POSITION) which must be written in every execution path of the s
hader.  Unconditional initialization may help.
        hlsl 2937: EVALUATE_OUT main(EVALUATE_CONSTANT_IN patch_constant, const
OutputPatch<EVALUATE_IN, 4> input) {
        (3077,5-24): error X4580: this variable dependent on potentially uniniti
alized data: output
        hlsl 3077: if(output.data_3 > 0.0f)
        (2937,18-96): error X4580: this variable dependent on potentially uninit
ialized data: main
        hlsl 2937: EVALUATE_OUT main(EVALUATE_CONSTANT_IN patch_constant, const
OutputPatch<EVALUATE_IN, 4> input) {
Defines: ,BLEND_SRC_FUNC_NONE,BLEND_DEST_FUNC_NONE,TESSELLATION_FACTOR=16,MAX_NU
M_LODS_HEIGHT=5,MAX_NUM_LODS_ALBEDO=5,MAX_NUM_LODS_NORMAL=5,MAX_NUM_LODS_MASKS=3
,NUM_DETAILS=4,NUM_MASKS=2,USE_INSETS,FAST_FRUSTUM_CULLING,HAS_DISPLACEMENT,HAS_
TRIPLANAR,,RENDER_MESH_NUM_INSTANCES=341,RENDER_MAX_FIELD_SPACERS=341,RENDER_MAX
_FIELD_ANIMATIONS=341,RENDER_MAX_FIELD_HEIGHTS=113,RENDER_MAX_FIELD_SHORELINES=1
13,OUT_GBUFFER_ALBEDO=0,OUT_GBUFFER_SHADING=1,OUT_GBUFFER_NORMAL=2,OUT_GBUFFER_M
ATERIAL_MASK=3,OUT_GBUFFER_LIGHTMAP=4,OUT_GBUFFER_FEATURES=5,OUT_GBUFFER_VELOCIT
Y=6,DIRECT3D11,EVALUATE

Material::create_shader(): can't compile "terrain_global_base"

It did work already, but lately I added a mesh in the scene, regenerated the terrain, and got this issue.
Generating the terrain again doesn't help, nor updating texture arrays.. 

As screen shoots display:

  • In editor, everything is OK
  • At runtime, land cover objects (grass, trees) are OK but terrain albedo and textures KO

Thanks in advance for support.

Kind regards,
Charles

log.html

editor_OK.PNG

runtime_KO.PNG

Link to comment

Hello Charles,

thank you for the detailed explanation, I need to run some tests with quadro GPUs. May I ask you to check if the same issue appears with OpenGL API?

And wich driver version you're using?  As far as I know, Nvidia offers two drivers for quadro users - the stable one on the newest. It worth checking both of them.

Thanks!

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

Link to comment

Charles,

also, please check if there are some remainings (data/core folder) left from evaluation version. If so, it's better to delete them. In all newly created projects core should be packed into an *.ung archive. 

Another thing that may help is cleaning shader cache files (shader_d3d11.cache).

If nothing works and your terrain is still broken in runtime - please send us a test scene. 

Thank you!

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

Link to comment

Hi,

Thanks for feedback and suggestions.

NVIDIA driver R396 U2 (397.93) is a QNF one. 
https://www.nvidia.com/download/driverResults.aspx/134638/en-us
I updated and tested last ODE driver 411.81.. but not working.

I have only a core.ung file, no data/core directory.
The first terrain (gTerrainMAR) may has been created when using SDK 2.7.1 but the new one (aTerrainMontain) with 2.7.2.
Deletion of shader_d3d11.cache and shader_d3d11_debug.cache didn't help. (as well editor.cache and unigine.cache).

But.. switch to OpenGL API seems to work ;)
It did work before with DirectX 11 and gTerrainMAR has no issue with this API.

Would you mind we should only use OpenGL?
Could you confirm it is right setup for a project with multiple (arbitrary/georeferenced) generated terrains?

Kind regards,
Charles

 

log.html

runtime_OK.PNG

Link to comment

May I ask you to check the following:

  1. Unparent terrain from Geodetic Pivot in aTerrainMontain and save it
  2. Run your app
  3. Will terrain work?

UPD

Sorry, just realized that I haven't answered your questions.

44 minutes ago, Lales.Charles said:

The first terrain (gTerrainMAR) may has been created when using SDK 2.7.1 but the new one (aTerrainMontain) with 2.7.2.

It shouldn't affect render anyhow, also, terrain global sees no difference between synthetic data and geo-referenced.

45 minutes ago, Lales.Charles said:

Would you mind we should only use OpenGL?

It looks like the easiest workaround for now. The issue could be caused by some specific in-project conditions or by mobile quadro GPU. Please, perform the short test I described above.

Thanks.

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

Link to comment

Hi,

Nop, unparent terrain from Geodetic Pivot doesn't fix it (back under DirectX 11)..
Even with cache files removed in between.

What about how to deal with multiple terrains in same project -> is it right what we've done?

Kind regards,
Charles

Edited by Lales.Charles
Link to comment
17 minutes ago, Lales.Charles said:

What about how to deal with multiple terrains in same project -> is it right what we've done?

It's okay, I've checked it once more and it worked.

Another thing that could be verified is debug mode. Please, try loading your project with DX in debug (just tick "Debug" in Customize Run Options window). Will shader fails to compile?

Anyway, to fix this we need to see a test scene. Can you send it?

Regards,
Vsevolod

 

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

Link to comment

Hi,

Yes I think it is suitable that we can exchange / submit complete project for you to debug efficiently.
How can we proceed? ~1.5GB archive..

Regarding DX in debug -> is it the attached SDK browser config?
Engine already in dev..

Kind regards,
Charles

SDKBrowserConfig.PNG

Link to comment
14 minutes ago, Lales.Charles said:

How can we proceed?

You can use our ftp or any file hosting you like:

 1. ftp://files.unigine.com
 2. user: upload
 3. password: iejeePheeH3che

16 minutes ago, Lales.Charles said:

Regarding DX in debug -> is it the attached SDK browser config?

Nope. check project settings:

image.png

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

Link to comment

Hi,

I'm starting MSVS 2015 debugger, with option: 
 

-data_path ../ -engine_config "../data/unigine.cfg" -extern_plugin Syncker,CigiClient,AppVive


In the code, I'm loading the world after CIGI init.
 

void AppSystemLogic::init_syncker(int master)
{
	// get Syncker interface
	int index = Engine::get()->findPlugin("Syncker");
	syncker_manager = (Syncker::ManagerInterface*)Engine::get()->getPluginData(index);

	// init Syncker Master or Syncker Slave
	int udp_port = atoi(udp_port_e->getText());
	int tcp_port = atoi(tcp_port_e->getText());
	int tcp_ping_port = atoi(tcp_ping_port_e->getText());

	if (master)
	{
		syncker_manager->initMaster(address_e->getText(), udp_port, tcp_port, tcp_ping_port);

		// load world!
		Console::get()->run("world_load aTerrainMontain"); //gTerrainMAR aTerrainMontain
	}
	else
		syncker_manager->initSlave(name_e->getText(), udp_port, tcp_port, tcp_ping_port);

	Syncker::SynckerInterface* syncker = syncker_manager->getSyncker();
	syncker->setView(0, views_el->getText()); // set Sync View from UI
	syncker->useDefaultProjections(0); // default projection is controlled by CIGI
	syncker->setDebug(1); // enable debug information
}

Kind regards,
Charles 

Link to comment

Hi,

I uploaded the project in archive CL-AHD_aTerrain-DirectX-issue.zip
Feel free to comment as well the way I tried to setup Vive + CIGI.. it is possibly not the right way to deal with camera / player, and there is an issue with objects collision when flying thanks to CIGI.. but that should be another post.

Kind regards,
Charles

Link to comment

Hi Charles,

this error occurs only in debug mode with DirectX API and is caused by a displacement feature in detail layer.

While we're looking for the reason of this behavior you can use one of the following workarounds:

  • if you need debug build only just switch to OpenGL (I assume you already did this) or temporarily disable displacement in "rocks" detail layer
  • you also can change to release build and everything will be working fine both with DirectX and displacement

Sorry for the inconvenience caused. I'll post here as soon as I find out more.

Thank you!

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

Link to comment
  • 2 weeks later...

Hi,

Not a big deal, I confirm it is fine in release build with both API and I can currently debug with OpenGL.
Could you share a perspective regarding this point? Future release?

Kind regards,
Charles

Link to comment

We've fixed this. The error was caused by the outdated d3dcompiler_47.dll library.

Just remove d3dcompiler_47.dll from bin directory of your project, the system lib will be used instead.

Fix for this issue will be available in the upcoming SDK update.

Thank you!

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

Link to comment

Hi,

Tried it, but not fixing from my side..
Compile debug, exec debug (IDE or batch), check that d3dcompiler_47.dll is properly removed.

Kind regards,
Charles

Link to comment

More likely its not working because of old d3dcompiler installed in system. You can try updating Windows SDK manually or just put the attached library into your project.

In the next Unigine SDK version there will be no such issue.

Thanks!

d3dcompiler_47.zip

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

Link to comment

Okay, let's try two things:

  • The easiest - remove all cache files from data folder of your project. Then run application and check if shader was compiled
  • If it's not working - let's check which d3dcompiler engine is linked to. You can use this tool: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer. Pressing Ctrl+D will reveal list of dlls that are curerntly used. If it's somehow still linked to the system one I'd recommend updating windows.

By the way, are you compiling x64 app? Because lib I gave you is x64.

 

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

Link to comment
  • morbid changed the title to [SOLVED] Can't compile "terrain_global_base"
×
×
  • Create New...