This patch adds the missing setMistType() and setMistIntensity() to the API
Details
Diff Detail
Event Timeline
I said this in D74, but I don't think it's acceptable to reuse the quadratic mist types to support exponential mist. If you want to add that type of mist you should add it as an option so the user can choose Quadratic/Linear/Inverse Quadratic/Exponential/Quadratic Exponential, and add support for those mist types in GLSL and Blender Internal (it's probably a pretty small change there).
Other than that it looks good to me.
| source/gameengine/Ketsji/KX_WorldInfo.h | ||
|---|---|---|
| 47 | Mipmap => Mist. | |
Adding the two exponential mist to the GLSL shader and to the drop menu is no problem.
But I don't know how to manipulate the drop menu so that only Linear/Exponential/Quadratic Exponential will be displayed in multi texture mode.
And in which mode should the used if Quadratic is used in GLSL and the user switch to multi texture mode.
The only solution that I have is to make an additional variable for the multi texture mist type.
See e.g. rna_SpaceView3D_viewport_shade_itemf for how to create an enum with dynamically changing elements.
Adding additional entries to the mist menu is fine, you don't even need to hide the unsupported mist types for multitexture, there's more places in the UI that don't do this, though it would be nice. The main thing is that they should be separate entries.
If the value is set to Quadratic, then you can interpret it as Linear the way it does now, since that's backwards compatible.
I decided to remove the exponential mist support for the multi texture mode.
I will add support for exponential mist later with a extra patch.
This cannot be applied to master without D148, which is waiting on feedback from Campbell.
This seems OK, generally I rather attribute access, but set functions are whats used already - so, fine to keep using I suppose.