Fix water raster offsetting with camera

This commit is contained in:
Michaël Lemaire 2013-07-07 00:45:08 +02:00
parent 2fe387918f
commit e09b812869

View file

@ -38,8 +38,6 @@ void waterRenderSurface(Renderer* renderer)
{
int chunk_factor, chunk_count, i;
Vector3 cam = renderer->getCameraLocation(renderer, VECTOR_ZERO);
double cx = cam.x;
double cz = cam.z;
double radius_int, radius_ext, base_chunk_size, chunk_size;
base_chunk_size = 2.0 / (double)renderer->render_quality;
@ -54,6 +52,9 @@ void waterRenderSurface(Renderer* renderer)
radius_ext = base_chunk_size;
chunk_size = base_chunk_size;
double cx = cam.x - fmod(cam.x, base_chunk_size);
double cz = cam.z - fmod(cam.x, base_chunk_size);
while (radius_int < 20000.0)
{
if (!renderer->addRenderProgress(renderer, 0.0))