Jump to content

[SOLVED] Trees still jittery at long distances from origin using WidgetSpriteViewport


photo

Recommended Posts

Hi,

 

This is kind of related to the previous bug report on trees - see https://developer.unigine.com/forum/topic/1973-solvedtree-motion-is-jittery-when-far-from-the-world-origin/?hl=shane#entry10707

 

When using WidgetSpriteViewport, tree motion is still very jittery. When using a Player this problem is fixed but since in most cases we use WidgetSpriteViewport, this is still a real problem for us and a bit of a showstopper. If you have any problems reproducing this issue, please let me know.

 

Link to comment

Frustum, could you please clarify the function/requirements of the camera offset parameter. Current documentation for getCameraOffset() is not really helpful, setCameraOffset does not exist in the documentation

Link to comment

Agree with Ulf here. I don't see how this relates to the modelview/projection matrices that I'm setting for the WidgetSpriteViewport.

Link to comment

OK so I've got it working using setCameraOffset, but I'm seeing a serious performance hit in doing so, almost like the image to be rendered is being generated twice. During the update cycle, I have code that looks something like this, which gets called every update cycle

 

WidgetSpriteViewport viewport; (I've tried this with WidgetSprite too)

...

 

Image i = new Image();
engine.render.setCameraOffset(dvec3(317238.0, 5814408.9, 0.0));
engine.render.renderImage2D(player.getProjection(), player.getIWorldTransform(), i, width, height, "", RENDER_HDR_DISABLED);
viewport.setImage(m_image, 1);
delete i;

 

The call to engine.render.renderImage2D is causing a big hit, but I'm not sure how to set it up so that the performance doesn't suffer. Previously my code looked something like this

 

viewport.setModelview(player.getIWorldTransform())

viewport.setProjection(player.getProjection())

 

Which performed far better (but obviously had jerky trees).

Link to comment
  • 2 weeks later...
  • 1 month later...

 

Apologies, I haven't got any test data to you sooner, but this still is a very important issue for us.

 

Interestingly this problem doesn't seem to happen when you are a moderately long way from the origin (x=50000, y=50000), but when you are a very very long way from the origin it does happen (which is what we require as shown in the test case attached). I've attached a test world with a single tree and a cpp file creating a WidgetSpriteViewport showing the problem (the test zip excludes the binaries). I've tested my world on both the Apr 30 SDK (one that we're using) and July 12 SDK and the same problem happens.

 

Also we've noted that the water is also shaky/jittery at large distances from the origin.

Link to comment
  • 2 weeks later...
×
×
  • Create New...