Jump to content

WidgetSpriteViewport abnormal operation


photo

Recommended Posts

Hi,

 

I am trying to use a WidgetSpriteViewport, but I am finding the results to be very abnormal.

 

WidgetSpriteViewport's camera  are using main camera's Modelview and .Projection  function .

 

But I have found it's different effect that in different position and functions ,as show blow:

 

First, put it in front of the .update() function ,the result is object is shaking .Please see the file name  is First .

Second ,put it in end of the  .update() function ,the result is object is shaking a little bit and  it seems like lost material .Please see the file name  is second .

 

As mentioned above ,the situation happened that only use mat4 to change position ,and the object speed very fast (test is 1000 Meters per second).however it is not happen at lower speed .

 

The main camera works fine, but when I set it to the WidgetSpriteViewport, it becomes very  abnormal .

 

The camera's position and look direction is changing every update.

 

Thanks

 

post-2101-0-24808900-1467631151_thumb.gif

post-2101-0-79734800-1467631169_thumb.gif

Link to comment

Hi Jia,

 

Could you please confirm that you are getting similar results to that: https://developer.unigine.com/forum/topic/3923-widgetspriteviewport-is-very-jumpy-when-the-viewport-changes/

If so, we are working on a fix that will be available with 2.3 SDK update.

 

To be 100% sure that we fixed your use-case too, could you please provide a minimal test scene (based on newly generated project from SDK Browser)?

 

Thank you!

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

Link to comment

Hi Jia,

 

To fix your issue you need to use following code in update():

int update() {
	time += (engine.game.getIFps()) * 1000;
	node.setWorldTransform(translate(Vec3(time, time, 0)));

	spriteViewport.setProjection(player.getProjection());
	spriteViewport.setModelview(player.getIWorldTransform());


	return 1;
}

But in this case there will be an issue with incorrect Velocity buffer calculation. To avoid id, please disable TAA and motion blur in console:

render_motion_blur 0 && render_antialiasing 0

Thanks!

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

Link to comment
×
×
  • Create New...