@@ -413,6 +413,8 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
413
413
CachedPixelShaderSetting<float , 3 > m_eye_position_pixel;
414
414
CachedVertexShaderSetting<float , 3 > m_eye_position_vertex;
415
415
CachedPixelShaderSetting<float , 3 > m_minimap_yaw;
416
+ CachedPixelShaderSetting<float , 3 > m_camera_offset_pixel;
417
+ CachedPixelShaderSetting<float , 3 > m_camera_offset_vertex;
416
418
CachedPixelShaderSetting<SamplerLayer_t> m_base_texture;
417
419
CachedPixelShaderSetting<SamplerLayer_t> m_normal_texture;
418
420
CachedPixelShaderSetting<SamplerLayer_t> m_texture_flags;
@@ -445,6 +447,8 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
445
447
m_eye_position_pixel (" eyePosition" ),
446
448
m_eye_position_vertex (" eyePosition" ),
447
449
m_minimap_yaw (" yawVec" ),
450
+ m_camera_offset_pixel (" cameraOffset" ),
451
+ m_camera_offset_vertex (" cameraOffset" ),
448
452
m_base_texture (" baseTexture" ),
449
453
m_normal_texture (" normalTexture" ),
450
454
m_texture_flags (" textureFlags" ),
@@ -493,7 +497,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
493
497
sunlight.b };
494
498
m_day_light.set (dnc, services);
495
499
496
- u32 animation_timer = porting::getTimeMs () % 100000 ;
500
+ u32 animation_timer = porting::getTimeMs () % 1000000 ;
497
501
float animation_timer_f = (float )animation_timer / 100000 .f ;
498
502
m_animation_timer_vertex.set (&animation_timer_f, services);
499
503
m_animation_timer_pixel.set (&animation_timer_f, services);
@@ -523,6 +527,18 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
523
527
m_minimap_yaw.set (minimap_yaw_array, services);
524
528
}
525
529
530
+ float camera_offset_array[3 ];
531
+ v3f offset = intToFloat (m_client->getCamera ()->getOffset (), BS);
532
+ #if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
533
+ camera_offset_array[0 ] = offset.X ;
534
+ camera_offset_array[1 ] = offset.Y ;
535
+ camera_offset_array[2 ] = offset.Z ;
536
+ #else
537
+ offset.getAs3Values (camera_offset_array);
538
+ #endif
539
+ m_camera_offset_pixel.set (camera_offset_array, services);
540
+ m_camera_offset_vertex.set (camera_offset_array, services);
541
+
526
542
SamplerLayer_t base_tex = 0 ,
527
543
normal_tex = 1 ,
528
544
flags_tex = 2 ;
0 commit comments