manuel.gysin Posted September 23, 2012 Share Posted September 23, 2012 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
frustum Posted September 23, 2012 Share Posted September 23, 2012 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
manuel.gysin Posted September 23, 2012 Author Share Posted September 23, 2012 Thanks a lot, got it working and understand it a bit more! Link to comment
Recommended Posts