1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix rendering glitches when far from the center of the map

This commit is contained in:
Novatux 2014-01-26 11:40:21 +01:00
parent 8e15179e7d
commit 062de11b4c
17 changed files with 112 additions and 35 deletions

View file

@ -35,7 +35,8 @@ Clouds::Clouds(
scene::ISceneNode(parent, mgr, id),
m_seed(seed),
m_camera_pos(0,0),
m_time(0)
m_time(0),
m_camera_offset(0,0,0)
{
m_material.setFlag(video::EMF_LIGHTING, false);
//m_material.setFlag(video::EMF_BACK_FACE_CULLING, false);
@ -318,6 +319,7 @@ void Clouds::render()
}
v3f pos(p0.X, m_cloud_y, p0.Y);
pos -= intToFloat(m_camera_offset, BS);
for(u16 i=0; i<4; i++)
v[i].Pos += pos;