Jump to content

Change render settings


photo

Recommended Posts

Hi there

 

I'm looking for a possibility to change the render settings, such as scattering from C++. I've seen the scripting functions, such as

engine.render.setScatteringTurbidity

But I couldn't found a approach to do this from c++...

 

Thanks in advance,

Renato

Link to comment

Hi Renato,

Currently most of render methods are absent in c++ api unfortunatelly. You can create a script world function and call it from c++ with engine.runWorldFunction.

// script 
void setScatteringTurbidity(float val) {    
   engine.render.setScatteringTurbidity(val);
}

// c++ 
engine->runWorldFunction(Variable("setScatteringTurbidity"),Variable(1.0f));

More info in this article https://developer.unigine.com/en/docs/1.0/cpp_api/usage/callbacks

Link to comment
×
×
  • Create New...