Jump to content

[SOLVED] ObjectWaterGlobal::getHeight() issue in coords far from origin


photo

Recommended Posts

Hi.

We have made a 3000x3000km terrain and now we are placing some buoys by geo coordinates. When we included the script in samples/worlds/expression_01.h to the buoys, the ones that are far from world origin do not get the water height properly. This can be easily reproduced in expression_01 by moving WorldExpression node to (200000.0, 200000.0, 0.0) point.

We also tried Object::getIntersection() and World::getIntersection() with similar behaviour. We are using 2.9.0.2 SDK version. Any tips for getting the water height?

Thanks, Javier

Link to comment

Hi Javier,

I've successfully reproduced this behavior. It looks like CPU and GPU implementation are not synchronized entirely. Right now we don't have any workaround for this behavior, sorry.

We will send you a patch as soon as it will be ready (hope it would not take a lot of time).

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

We suggest to modify the code in <SDK>/source/engine/objects/ObjectWaterGlobal.cpp:476.

Before:

const Vec2 position_xy = Vec2(geo_pos.x, geo_pos.y);

After:

Vec2 position_xy = Vec2(geo_pos.x, geo_pos.y);

position_xy.x = mod(position_xy.x, octaves_periodic_position.x);
position_xy.y = mod(position_xy.y, octaves_periodic_position.y);

Could you please try this approach?

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • silent changed the title to [SOLVED] ObjectWaterGlobal::getHeight() issue in coords far from origin
×
×
  • Create New...