Page MenuHome

Multitexture mist UI fix
AbandonedPublic

Authored by Thomas Szepe (hg1) on Dec 3 2013, 10:11 PM.

Details

Summary

Fix the Mist UI in Multitexture mode. The fixed OpneGL pipeline only supports fog start and end for linear (GL_LINEAR) mist. Intensity is only available for quadratic (GL_EXP) and inverse quadratic (GL_EXP2) mist.

Diff Detail

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Dec 23 2013, 5:08 PM

It seems that start/end do influence taken into account for quadratic? What I did:

  • Load Factory Settings
  • Select 'Blender Game'
  • Enable mist (it's quadratic by default)
  • Press P (see almost no mist)
  • Set start to 0
  • Press P (see more mist)

There is a bug in the BGE source. At the moment the BGE the mistype is not set and always renders linear mist.
In my new BGE_API_mist_ambient_fix (atm not in the patch tracker) I have fixed this.

Sorry I have forgotten to mention this.

I still don't understand this change then, it seems to me that mist is quite useless if you can't specify start/depth?

It seems reasonable if the game engine supports only certain types of falloff, and the falloff button can be hidden/disabled depending on that, and if you add support for all mist falloff types even better. But if there is no control over start/depth then how do you use them, having start and depth set to some hardcoded value is rarely going to match what you need?

The OpenGL EXP fog starts right at the camera but progresses in an exponential way. The density is increasing depending on the depth and the intensity (D) . The formulae for these modes are F = e^(-D * z) for GL_EXP and F = e^((-D * z)^2) for GL_EXP2.

Ok, but then the change should be to add more mist falloff types, rather than replacing the quadratic and inverse quadratic types, and give the exponential falloff a density option. Ideally that exponential falloff would be implemented everywhere (GLSL and Blender Internal), since it's generally useful and nice to have it matching rather than only having it available for the multitexture case.

Anyway, it's confusing here because I can't really review this change without also reviewing the other changes that go along with this. If you can turn this into a patch to "Add support for exponential mist falloff" then we can review the UI and code changes, it's a bit strange to do them separately because the two are tightly coupled. I think that would still end being a lot smaller than the big patch. I know I'm asking a lot .. but it's quite difficult for me to review otherwise.

Abandon revision. Patch integrated in https://developer.blender.org/D148.