|
10 | 10 | #include "Common/object_broker.h"
|
11 | 11 | #include "Common/LevelGameDef.h"
|
12 | 12 |
|
| 13 | +ENGINE_API float SunshaftsIntensity = 0.f; |
| 14 | + |
13 | 15 | void CEnvModifier::load(IReader* fs, u32 version)
|
14 | 16 | {
|
15 | 17 | use_flags.one();
|
@@ -438,42 +440,50 @@ void CEnvDescriptorMixer::lerp(
|
438 | 440 | wind_velocity = fi * A.wind_velocity + f * B.wind_velocity;
|
439 | 441 | wind_direction = fi * A.wind_direction + f * B.wind_direction;
|
440 | 442 |
|
441 |
| - m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity; |
442 |
| - m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; |
| 443 | +#ifdef DEBUG |
| 444 | + if (SunshaftsIntensity > 0.f) |
| 445 | + m_fSunShaftsIntensity = SunshaftsIntensity; |
| 446 | + else |
| 447 | +#endif |
| 448 | + { |
| 449 | + m_fSunShaftsIntensity = fi * A.m_fSunShaftsIntensity + f * B.m_fSunShaftsIntensity; |
| 450 | + } |
443 | 451 |
|
444 |
| - m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; |
| 452 | +m_fWaterIntensity = fi * A.m_fWaterIntensity + f * B.m_fWaterIntensity; |
445 | 453 |
|
446 |
| - // colors |
447 |
| - //. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); |
448 |
| - sky_color.lerp(A.sky_color, B.sky_color, f); |
449 |
| - if (Mdf.use_flags.test(eSkyColor)) |
450 |
| - sky_color.add(Mdf.sky_color).mul(modif_power); |
| 454 | +m_fTreeAmplitudeIntensity = fi * A.m_fTreeAmplitudeIntensity + f * B.m_fTreeAmplitudeIntensity; |
451 | 455 |
|
452 |
| - //. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); |
453 |
| - ambient.lerp(A.ambient, B.ambient, f); |
454 |
| - if (Mdf.use_flags.test(eAmbientColor)) |
455 |
| - ambient.add(Mdf.ambient).mul(modif_power); |
| 456 | +// colors |
| 457 | +//. sky_color.lerp (A.sky_color,B.sky_color,f).add(Mdf.sky_color).mul(modif_power); |
| 458 | +sky_color.lerp(A.sky_color, B.sky_color, f); |
| 459 | +if (Mdf.use_flags.test(eSkyColor)) |
| 460 | + sky_color.add(Mdf.sky_color).mul(modif_power); |
456 | 461 |
|
457 |
| - hemi_color.lerp(A.hemi_color, B.hemi_color, f); |
| 462 | +//. ambient.lerp (A.ambient,B.ambient,f).add(Mdf.ambient).mul(modif_power); |
| 463 | +ambient.lerp(A.ambient, B.ambient, f); |
| 464 | +if (Mdf.use_flags.test(eAmbientColor)) |
| 465 | + ambient.add(Mdf.ambient).mul(modif_power); |
458 | 466 |
|
459 |
| - if (Mdf.use_flags.test(eHemiColor)) |
460 |
| - { |
461 |
| - hemi_color.x += Mdf.hemi_color.x; |
462 |
| - hemi_color.y += Mdf.hemi_color.y; |
463 |
| - hemi_color.z += Mdf.hemi_color.z; |
464 |
| - hemi_color.x *= modif_power; |
465 |
| - hemi_color.y *= modif_power; |
466 |
| - hemi_color.z *= modif_power; |
467 |
| - } |
| 467 | +hemi_color.lerp(A.hemi_color, B.hemi_color, f); |
468 | 468 |
|
469 |
| - sun_color.lerp(A.sun_color, B.sun_color, f); |
| 469 | +if (Mdf.use_flags.test(eHemiColor)) |
| 470 | +{ |
| 471 | + hemi_color.x += Mdf.hemi_color.x; |
| 472 | + hemi_color.y += Mdf.hemi_color.y; |
| 473 | + hemi_color.z += Mdf.hemi_color.z; |
| 474 | + hemi_color.x *= modif_power; |
| 475 | + hemi_color.y *= modif_power; |
| 476 | + hemi_color.z *= modif_power; |
| 477 | +} |
470 | 478 |
|
471 |
| - R_ASSERT(_valid(A.sun_dir)); |
472 |
| - R_ASSERT(_valid(B.sun_dir)); |
473 |
| - sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); |
474 |
| - R_ASSERT(_valid(sun_dir)); |
| 479 | +sun_color.lerp(A.sun_color, B.sun_color, f); |
| 480 | + |
| 481 | +R_ASSERT(_valid(A.sun_dir)); |
| 482 | +R_ASSERT(_valid(B.sun_dir)); |
| 483 | +sun_dir.lerp(A.sun_dir, B.sun_dir, f).normalize(); |
| 484 | +R_ASSERT(_valid(sun_dir)); |
475 | 485 |
|
476 |
| - VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); |
| 486 | +VERIFY2(sun_dir.y < 0, "Invalid sun direction settings while lerp"); |
477 | 487 | }
|
478 | 488 |
|
479 | 489 | //-----------------------------------------------------------------------------
|
|
0 commit comments