Jump to content

[SOLVED] engine.render.getEnvironmentCoefficients


photo

Recommended Posts

Hello

 

 

Can somebody please tell me how engine.render.getEnvironmentCoefficients and engine.render.setEnvironmentCoefficients are used?

 

The tracker has these values configured:

 

<parameter type="render.environment.texture">
           	<key time="0" name="demos/valley/textures/environment_night_moon_sunny.dds">0.111247 0.152819 0.211115 0.0143186 0.0166008 0.0213792 0.0358719 0.0442284 0.067462 -0.0203035 -0.0258403 -0.0376952 -0.0143864 -0.0203393 -0.0315282 0.00263392 0.00447881 0.00785854 -0.00552028 -0.00730279 -0.0104133 -0.00425623 -0.00575169 -0.0106987 0.00375638 0.00538275 0.00892438</key>

 

But what are these values? A code sample to switch between two environment textures would be superb. (We can't use the tracker at the moment)

 

 

Thanks

Manuel

Link to comment

This is pre-backed spherical harmonic coefficients for the environment texture. This coefficients can be linearly interpolated to change environments.

You can obtain this coefficients from engine.render.getEnvironmentCoefficients() function after calling of engine.render.setEnvironmentTextureName("my_env") function.

Or you can use create_coefficients() script function from data/core/systems/widgets/widget_line_environment.h file.

Link to comment
×
×
  • Create New...