Jump to content

Animations in WidgetSpriteViewport


photo

Recommended Posts

Our application switches between using a WidgetSpriteViewport and a game wide Player.

Recently I've been testing out some animations and I've been finding that the speed of the animations shown differ significantly between the 2 methods of rendering to a window. The animation speed on the game wide player is as expected, whilst the same object playing the same animation in a WidgetSpriteViewport is animating significantly more slowly (I call engine.game.setPlayer(0) before using the WidgetSpriteViewport). Is this to be expected?

Link to comment

Yep, still no fix for described problem, checked the source. As a workaround you could try to set viewort frame rate to very high value e.g. viewport.setIFps(1.0f/250.f) to force rendering each frame.

Link to comment

Ulf, your point is clear, but still it's a feature rather than a bug. In a lot of cases lowered frame rate does not make visual difference. I've added a notice into docs, so it should be OK now.

Link to comment

Hi manguste, notice is a very good idea. Still thinking that it would be more intuitive the other way: by default WidgetSpriteViewport renders at the same framerate as main viewport and this can be customized by users to lower framerates via setIFPS(1/FPS).

 

"For it to be rendered at the rendering frame rate, use setIFps()" seems to me still a little bit unclear. Prosposal "For it to be rendered at different frame rate, use setIFps(). For it to be rendered at the same frame rate as the main window, use setIFps(0.0f)"

Link to comment

I agree with Ulf here. It was certainly my expectation that WidgetSpriteViewport should render at the same framerate as the main viewport.

Link to comment

Oh good :) So the final variant in docs goes:

 

By default, the sprite viewport is rendered at the same frame rate as the main Unigine viewport. For it to be rendered at different frame rate (for example, lower one in order to decrease the rendering load), use setIFps().
Link to comment
×
×
  • Create New...