Creating mist in UPBGE?

How can I make actual fog and mist in UPBGE and program it? What I am talking about is the old BGE mist. I loved how I could use Python to manipulate the mist colours, mist distance, everything related to mist. How can this be done in UPBGE?

An example would be this:

import bge
import bge.logic as gl

def main(cont):

    own = cont.owner

    sce = gl.getCurrentScene()
    world =
    mist = sce.mist
    mcol = world.setMistColor([own["mistR"],own["mistG"],own["mistB"])
    mi = world.setMistIntensity(own['mistIntensity'])
    on = world.mistEnable(own["mistOn"])
    miDist = world.setMistDistance(own["mistDistance"])

All of these are some of the many fun things you could do with mist in the old BGE. How can I accomplish these things in UPBGE? It appears these mist things were depreciated in 0.30. Sorry if the code isn’t that correct, I was copying from memory of me having printed out the attributes from the console. It is cool to manipulate mist in BGE, and would love to do so again in UPBGE.

i’ve heard that we can access to the bpy library in upbge 0.3. So if you fly your mouse over anything in the blender ui, you get the data path

for example the mist in blender 2.79 bpy.dataWorlds['World'].mist_settings.use_mist

Otherwise, just use the implemented existing modules upbge 0.3+

trick : just use the search bar with your keywords

There are also these wonderful fog shader filters by @ MattFrnndz:

See also here: