Jump to content

[SOLVED] #define in system script not taking effect


photo

Recommended Posts

Situation 1 -- define RENDER_SIMPLE only in system script

system script (unigine.cpp):

#define RENDER_SIMPLE

engine config (unigine.cfg):

<item name="extern_define" type="string"></item>

Console after world load:

Loading "core/materials/default/unigine_post.mat" 27 materials 55 shaders 4 ms

Default materials are loaded. I would expect simple materials loaded.

 

----

 

Situation 2 -- define RENDER_SIMPLE only in engine config

system script has no #define present

engine config:

<item name="extern_define" type="string">RENDER_SIMPLE</item>

Console after world load:

Loading "core/materials/simple/unigine_post.mat" 9 materials 9 shaders 0 ms

Simple materials are loaded as expected.

 

----

 

Situation 3 -- define RENDER_SIMPLE in both system script and engine config

system script:

#define RENDER_SIMPLE

engine config:

<item name="extern_define" type="string">RENDER_SIMPLE</item>

Console after world load:

Parser::setDefine(): "RENDER_SIMPLE" is already defined
{...}
Loading "core/materials/simple/unigine_post.mat" 9 materials 9 shaders 0 ms

Simple materials loaded as expected. Parser complains about RENDER_SIMPLE being defined twice, which it is of course. This shows that both instances of the define are detected by the engine but only the one in the engine config is actually taking effect.

Link to comment
×
×
  • Create New...