craig.biggs_ Posted March 5, 2012 Share Posted March 5, 2012 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
ulf.schroeter Posted March 5, 2012 Share Posted March 5, 2012 might be related to this one https://developer.un...__fromsearch__1 As far as I can remember engine renders viewports always with reduced frame rate which it should't by default 1 Link to comment
ulf.schroeter Posted March 5, 2012 Share Posted March 5, 2012 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
craig.biggs_ Posted March 5, 2012 Author Share Posted March 5, 2012 Thanks Ulf that does the trick. And seems to work fine when the app is Vsync'd. Link to comment
manguste Posted March 7, 2012 Share Posted March 7, 2012 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
ulf.schroeter Posted March 7, 2012 Share Posted March 7, 2012 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
craig.biggs_ Posted March 7, 2012 Author Share Posted March 7, 2012 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
manguste Posted March 11, 2012 Share Posted March 11, 2012 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
Recommended Posts