Performance problems with render to texture method
My game currently gets a solid 60 fps. I want to be able to take the current screen of the game and apply some effects to it (like warping). To do this I am using an FBO to render everything to a texture, and then drawing that texture to the screen.
However, as soon as I do this my fps drops to around 50, which due to the fact that I am using CADisplayLink to drive my render loop is the same as the game doing 30fps.
The texture I am rendering to is 1024x1024 since I am mostly developing for the iPad right now (haven't tested on the iPhone yet).
Does this seem right? Should the fps really drop that much just to render to a texture and then render the texture?
Are there any common pits that people fall into when doing render to texture? I have blending turned off ... anything else?
Thanks
However, as soon as I do this my fps drops to around 50, which due to the fact that I am using CADisplayLink to drive my render loop is the same as the game doing 30fps.
The texture I am rendering to is 1024x1024 since I am mostly developing for the iPad right now (haven't tested on the iPhone yet).
Does this seem right? Should the fps really drop that much just to render to a texture and then render the texture?
Are there any common pits that people fall into when doing render to texture? I have blending turned off ... anything else?
Thanks
You can't realistically expect rendering to occur at 60 FPS if you are trying to draw anything interesting. The more you make it do, the more it gets bogged down in processing, the less it can draw. If you skip one frame because you couldn't draw in time, you instantly drop down to something less than 60, right? So really, you need to update your game at a constant rate, but draw whenever the opportunity arises. See:
heh and heh
heh and heh
mbw234 Wrote:My game currently gets a solid 60 fps. I want to be able to take the current screen of the game and apply some effects to it (like warping). To do this I am using an FBO to render everything to a texture, and then drawing that texture to the screen.
However, as soon as I do this my fps drops to around 50, which due to the fact that I am using CADisplayLink to drive my render loop is the same as the game doing 30fps.
The texture I am rendering to is 1024x1024 since I am mostly developing for the iPad right now (haven't tested on the iPhone yet).
Does this seem right? Should the fps really drop that much just to render to a texture and then render the texture?
Are there any common pits that people fall into when doing render to texture? I have blending turned off ... anything else?
Thanks
That's normal ... rtt targets will drop your FPS by about 5-7 just for having one, regardless of your render complexity.
You are using a lot more fillrate by doing that RRT pass, so it is expected that it would drop some.
I disagree that it's impossible to do anything interesting at 60fps. Twilight Golf used a ton of fillrate to do it's shadow effects and we are able to get a pretty solid 60fps on the 3GS and 40-60 on earlier devices depending on the level.
I disagree that it's impossible to do anything interesting at 60fps. Twilight Golf used a ton of fillrate to do it's shadow effects and we are able to get a pretty solid 60fps on the 3GS and 40-60 on earlier devices depending on the level.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Skorche Wrote:I disagree that it's impossible to do anything interesting at 60fps. Twilight Golf used a ton of fillrate to do it's shadow effects and we are able to get a pretty solid 60fps on the 3GS and 40-60 on earlier devices depending on the level.
Stutter stutter stutter on my first gen iPod Touch on many levels.
My point wasn't that you can't do anything at 60 FPS. My point was that you need to learn to compensate for when you can't.
<-- sorry, does this look like frustration? ... if you are trying to do something that causes you to skip a frame, you skip a frame. That means you aren't drawing at 60 FPS anymore. What part of that concept did I not convey?
<-- sorry, does this look like frustration? ... if you are trying to do something that causes you to skip a frame, you skip a frame. That means you aren't drawing at 60 FPS anymore. What part of that concept did I not convey?
I got 60 FPS and used RTT, two things that helped were:
1. Not using a big texture. I split my background up in to a grid of smaller RTT textures (128px * 64px), that I only render to if something changes. Rendering to bigger textures caused a drop below 60 FPS.
2. I render my textures to the back buffer without using any kind of alpha blending. Someone adviced me this wouldn't make a difference, but it did!
1. Not using a big texture. I split my background up in to a grid of smaller RTT textures (128px * 64px), that I only render to if something changes. Rendering to bigger textures caused a drop below 60 FPS.
2. I render my textures to the back buffer without using any kind of alpha blending. Someone adviced me this wouldn't make a difference, but it did!
Blog - http://bit.ly/mrqwak
Games - http://bit.ly/mrqwakgames
Twitter - http://www.twitter.com/mrqwak
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| iPad,render to texture, low framerate | ldynasa | 0 | 2,170 |
Nov 13, 2010 12:34 AM Last Post: ldynasa |
|
| Render to texture failing | headkaze | 7 | 5,747 |
Sep 1, 2010 09:47 PM Last Post: headkaze |
|
| Texture performance | JPvdB | 5 | 2,644 |
Feb 22, 2010 12:49 PM Last Post: cmiller |
|
| Render to texture performance | iPhoneGG | 2 | 3,314 |
May 18, 2009 03:31 PM Last Post: ShiftZ |
|
| OpenGl ES Texture Problems | jhbau1000 | 4 | 3,725 |
Mar 24, 2009 02:41 PM Last Post: AnotherJake |
|

