Fix water raster offsetting with camera
This commit is contained in:
parent
2fe387918f
commit
e09b812869
1 changed files with 3 additions and 2 deletions
|
@ -38,8 +38,6 @@ void waterRenderSurface(Renderer* renderer)
|
||||||
{
|
{
|
||||||
int chunk_factor, chunk_count, i;
|
int chunk_factor, chunk_count, i;
|
||||||
Vector3 cam = renderer->getCameraLocation(renderer, VECTOR_ZERO);
|
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;
|
double radius_int, radius_ext, base_chunk_size, chunk_size;
|
||||||
|
|
||||||
base_chunk_size = 2.0 / (double)renderer->render_quality;
|
base_chunk_size = 2.0 / (double)renderer->render_quality;
|
||||||
|
@ -54,6 +52,9 @@ void waterRenderSurface(Renderer* renderer)
|
||||||
radius_ext = base_chunk_size;
|
radius_ext = base_chunk_size;
|
||||||
chunk_size = 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)
|
while (radius_int < 20000.0)
|
||||||
{
|
{
|
||||||
if (!renderer->addRenderProgress(renderer, 0.0))
|
if (!renderer->addRenderProgress(renderer, 0.0))
|
||||||
|
|
Loading…
Reference in a new issue