Can't handle this alpha/fog issue :( please help!

Hi Guys!

I try really hard to figure this out on my own but :confused: it don’t work…
The facts are:
-this is a iPhone game
-I use only 2 (“mobile”) shaders (Vertex Lit and Alpha Vertex Lit)
-there are no problems with poly/tris/Vertex count, Texture size etc
-the textures are all TGA (in case of the alpha bled stuff they use the Alpha channel)

and here is the problem:

Left is the same scene on iOS device (iphone 4) and right the same scene in the editor…
What are this black artifacts on the alpha? This only happens in fog.
Is there any way to make this run correctly? maybe I have forgot about something?

any help or even hint is appreciated!!

thanks in advanced

cheers

Sim

What does that mean? Where did you get them? “Alpha Vertex Lit” is a really terrible name; it propagates the myth that a lot of people around here seem to have, where alpha = “transparency”. It doesn’t have to.

A few things I have come across in IOS dev in regards to both alpha and fog.

Avoid alpha-testing, choose alpha-blending instead. Alpha Test is using hard edged alpha (it’s either 1 or 0, on/off alpha) and alpha blending is using an alpha channel that has different shades of gray (different levels of transparency).

Avoid fog (especially on newer than iPhone 3GS devices). It’s a performance killer I guess or causes draw issues.

Lastly check into the Unity shader your using and make sure it takes into account the alpha channel embedded within the TGA image. It might be only looking at the vertex alpha information applied to the geometry from your 3d package…(i.e. the same thing as vertex coloring on a vertex, but it’s transparency is also affected.)

Trees and alpha blending alone don’t tend to work out well. It is an option though; it’ll just look weird.

:frowning:

Why would you be using TGA for anything?

not knowing that PNG is better and has 10 times better support in applications :slight_smile:

But the problem here is really the fog. Check out the iOS thread on fog on OpenGL ES 2.0 devices (means 3GS+ or iPad)

Where is that? Search tells me there are no threads with fog in the title in the iOS section.

Edit: Rather, Search is telling me there are no matches for anything. Guess it’s broken.

To the OP: Is OpenGL 1.1 ES sufficient for your needs? I ask because of what I see here.

Use alpha blending when ever you can in IOS! Transparency or cut off shader is the killer for IOS along with fog!

I reported this bug, way before UT3.0 final release, 3.1. And re-reported again last week.

JEssy: "Sorry I meant the standard mobile shaders: “Mobile/Transparent/Vertex Color” and “Mobile/Vertex Color”

I figured out right now that I was using the “old” standard iphon shaders from Unity Iphone 1.7 - Now when I use the default Mobil shaders - the fog is not working :frowning:

I see there are problems with fog on the iOS… but is there any way to even fake this?
Our goal is to make a Silent Hill (Psx) graphic with this thick fog

It can be even something like in SH - so not with this soft gradient.

I don’t know what you’d be using the latter for, so I’ll comment on the former. It makes no sense. There’s all this setup for lighting (much of which won’t work on iOS anyway), but the lighting isn’t used. There’s some other shader like that, in that package, for which I tried reporting a bug, but the bug tracker was broken at the time, and I don’t even remember which it was. Also, neither of those shaders use fog, so I’m pretty confused about your intentions.

Again, it’s potentially an OpenGL ES 2.0 issue. Please answer the last question from my previous post, and tell us if you’ve tried the scene, building for 1.1.

Fog is a pretty big framerate drag at 640x960 regardless of OpenGL version. If you need fog it’s best to use 320x480.

–Eric

it is an OpenGL ES 2.0 issue… on 1.1 it works :slight_smile: very very slow but it works
thanks Guys!! hope the unity guys will correct this…

I think it’s something Apple has to correct, rather than Unity.

–Eric

Eric5h5 true 640x960 is bad for foggy scenes… Damn! hope apple or Unity will figure this out :wink:

thanks guys! Your all help a lot in this “brain breaking” case :slight_smile:

I have this same issues and it works fine with old iDevices (OglES1.1), only visible with OglES2.0. But I’m not sure if comes from Unity or Apple.

tatoforever - but OglES1.1 is not a solution… I mean we all want to use Retine display and with 1.1 its impossible :frowning: please unity do all you best to fix this :slight_smile:

I reported this bug and Unity is now fixing it. :slight_smile:

targeting retina works with 1.1 and 2.0, the screen size etc has really no impact here.

if you don’t use pixel shaders, there is no reason targeting 2.0 for rendering as you can only lose performance, not gain it at the time

A ok dreamora I thought that one can’t work without the other one :slight_smile: (mean retina without Ogl2.0)
So ok I think I will use 1.1 only thanks!!

I understand that many games with wide aeras are using fog to vanish theyr object nicely, due to much objects/polys, instead of poping them off brutaly. =)
but fog does also give the feeling of an wide aera itself! What i want to say is, that the room gets bigger and the characters in there are getting optically smaller. in my project fog is an absolut necessary effect to get the right feeling of a big scene! And there is nothing to be alpha blended. Its an static scene, which uses transparency objects.

so i need this opengles2.0 fix too.

Poras, the Unity QA Engineer wrote on 15.12.2010 this thread “Fog issue is now fixed and fix should be available in the next release.”

let’s hope the new update will be out soon!