Matching Fog in iOS to Editor

I’m struggling to match fog deployed on an iOS device (in the example case an iPhone4) and the editor:

Ultimately this is in an effort to add a simple ground-plane to the scene and I need to blend the edge of the plane to the skybox. In this case, I’m trying to use fog with the same color as the bottom half of the skybox… But the gag fails on iOS.

This is linear fog:

It’s almost as if the scale is different on the device, but then again, fog is such a finicky thing, I have no clue why this isn’t working.

I’ve been diggin’ thru the forum and answers and failed to find one… an answer.

Does anyone have, 1: A suggestion on how to get my fog to match? Or 2: A better suggestion for a simple feeling of ground below the clouds? (I have yet to find successful skybox with both clouds AND ground…)

did you try the other, non linear fogs?
Also, are you in opengl es 1.1? (either generally or by disabling the define in appcontroller)
cause on 2.0, from what I recall, fog won’t work right

Generally: due to performance I would consider looking for a replacement of hardware fog as its impact is pretty hefty on retina / ipad resolutions

I chose not to use Exp or Exp2 as they don’t use “Start and End” and I wanted to shove the fog away from camera (with the 2500 and 7500 values for start and end). The Exp fogs only seem respond to density, which doesn’t work. I can’t get a clean blend with horizon without destroying all of the foreground detail:

The horizon is still visible, but the FG is going blurry:

But when I get a density setting that does blur the horizon line, the FG is too faded:

When it comes to Frame Rate, this this style of game doesn’t need high FR, so harware fog would be fine for this particular game. I was hoping for a somewhat more simple solution to this other than creating a custom sky box… It would also give me, if I chose, a little more leeway to creating simple geometry for the ground if I needed to:

Seems that this is solved by forcing OpenGL ES1.1 in xCode by setting this line to 0

#define USE_OPENGLES20_IF_AVAILABLE 0

in the AppController.mm found in the xCode project:

Fog is calculated per vertex on iOS/Android in OpenGL ES 2.0 (for efficiency reasons, because calculating it per pixel would kill performance). But on PC/Mac/consoles it’s calculated per pixel. So if your ground plane has very few vertices, you only get very approximate fog.

What the hardware does in OpenGL ES 1.1 case is not exactly specified, apparently on iOS the drivers do “something like per pixel”.

Aras,

Thanks for the explanation. That makes sense.

The terrain (such as it is) is Very Low Poly:

(As a matter of fact is started out as a 2-tri plane, as can be seen in the lower image of the two marked “editor”)