x


Poor fog performance on the iPad?

I have a simple scene set up with the following items in it

  1. Skybox (using the RenderFX/Skybox material)
  2. Ambient light
  3. Fog (density of .2)
  4. Tessellated plane with a vertex lit material, 0 shininess, no emissive.

I modified http://AppController.mm to set kFps to 60.

I also added a little script to toggle RenderSettings.fog.

When the fog is active, the game gets around 30fps.

With the fog disabled, I'm getting 60.

(I'm using something similar to this script to draw the FPS on the device: http://www.unifycommunity.com/wiki/index.php?title=FramesPerSecond )

My question is twofold. One, is this expected behaviour, and two, if it isn't, is there something I'm missing to make fog not kill performance as much?

more ▼

asked Apr 06 '10 at 10:47 PM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

Is this in the iPad simulator or on the actual device that the performance is degrading?

Apr 06 '10 at 10:51 PM Murcho
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

There currently seems to be a bug in iPhoneOS / iOS that makes rendering fog very inefficient. So while not exactly "as designed", this can be considered "expected behavior". So you should avoid using fog on the iPad.

I'm not perfectly sure how relevant this is for Unity iPhone - but you might want to check out Creating a fogless version of a built-in shader. If that works well for iPhone, you should be able to switch all shaders to "without fog" and then, whenever fog doesn't kill performance anymore could return to the original shaders.

more ▼

answered Jun 16 '10 at 01:39 PM

jashan gravatar image

jashan
10.1k 25 40 116

(comments are locked)
10|3000 characters needed characters left

Very likely the iPad's framerate is tied to the LCD's refresh rate and works only in discrete increments. That means that your framerate would drop from 60 to 30, not something like 51 or 46. You can read more at the forums - it's brought up every so often.

Having said that, I understand fog isn't exactly cheap, but someone else can probably provide better numbers.

more ▼

answered Apr 07 '10 at 07:24 AM

Ricardo gravatar image

Ricardo
5.2k 20 32 96

The thing is, I added another object to the scene (a large additive particle), and the framerate goes from 15fps with fog to 45 fps with fog.

Apr 07 '10 at 03:47 PM Tetrad
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1999
x660
x360
x177
x86

asked: Apr 06 '10 at 10:47 PM

Seen: 3285 times

Last Updated: Apr 06 '10 at 10:47 PM