#include "tool.h"
#include "guiChatConsole.h"
#include "config.h"
+#include "version.h"
#include "clouds.h"
#include "particles.h"
#include "camera.h"
float daynight_ratio_f = (float)daynight_ratio / 1000.0;
services->setPixelShaderConstant("dayNightRatio", &daynight_ratio_f, 1);
+ u32 animation_timer = porting::getTimeMs() % 100000;
+ float animation_timer_f = (float)animation_timer / 100000.0;
+ services->setPixelShaderConstant("animationTimer", &animation_timer_f, 1);
+ services->setVertexShaderConstant("animationTimer", &animation_timer_f, 1);
+
+ LocalPlayer* player = m_client->getEnv().getLocalPlayer();
+ v3f eye_position = player->getEyePosition();
+ services->setPixelShaderConstant("eyePosition", (irr::f32*)&eye_position, 3);
+ services->setVertexShaderConstant("eyePosition", (irr::f32*)&eye_position, 3);
+
// Normal map texture layer
- int layer = 1;
+ int layer1 = 1;
+ int layer2 = 2;
// before 1.8 there isn't a "integer interface", only float
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR < 8)
- services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer, 1);
+ services->setPixelShaderConstant("normalTexture" , (irr::f32*)&layer1, 1);
+ services->setPixelShaderConstant("useNormalmap" , (irr::f32*)&layer2, 1);
#else
- services->setPixelShaderConstant("normalTexture" , (irr::s32*)&layer, 1);
+ services->setPixelShaderConstant("normalTexture" , (irr::s32*)&layer1, 1);
+ services->setPixelShaderConstant("useNormalmap" , (irr::s32*)&layer2, 1);
#endif
}
};
Hud hud(driver, guienv, font, text_height,
gamedef, player, &local_inventory);
+ bool use_weather = g_settings->getBool("weather");
+
for(;;)
{
if(device->run() == false || kill == true)
fog_range = 100000*BS;
else {
fog_range = draw_control.wanted_range*BS + 0.0*MAP_BLOCKSIZE*BS;
- if(g_settings->getBool("weather"))
+ if(use_weather)
fog_range *= (1.5 - 1.4*(float)client.getEnv().getClientMap().getHumidity(pos_i)/100);
fog_range = MYMIN(fog_range, (draw_control.farthest_drawn+20)*BS);
fog_range *= 0.9;
//TimeTaker guiupdatetimer("Gui updating");
- const char program_name_and_version[] =
- "Minetest " VERSION_STRING;
-
if(show_debug)
{
static float drawtime_avg = 0;
std::ostringstream os(std::ios_base::binary);
os<<std::fixed
- <<program_name_and_version
+ <<"Minetest "<<minetest_version_hash
<<" (R: range_all="<<draw_control.range_all<<")"
<<std::setprecision(0)
<<" drawtime = "<<drawtime_avg
}
else if(show_hud || show_chat)
{
- guitext->setText(narrow_to_wide(program_name_and_version).c_str());
+ std::ostringstream os(std::ios_base::binary);
+ os<<"Minetest "<<minetest_version_hash;
+ guitext->setText(narrow_to_wide(os.str()).c_str());
guitext->setVisible(true);
}
else