Sign in to follow this  
photo

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

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

Share this post


Link to post

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).

Share this post


Link to post

Hi Silent, we will wait for the patch. Right now we will set low beauforts to minimize visual impact.

Thanks

Share this post


Link to post

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!

Share this post


Link to post
Sign in to follow this