GroundFogEffect Need Help

https://playground.babylonjs.com/#63NSAD#4

So I am trying to follow along with, http://www.terathon.com/lengyel/Lengyel-UnifiedFog.pdf

and normally I can figure stuff like this out… but I am kind drawing a blank about these bugs right now with it.

Anyone who things they know how to fix this I would love to hear some input.

Just move the camera around and you will see how the fog its screwy, its something to do with my height calculation I think.

Was able to find a java deployment of it (BetterGroundFogFilter - Contribution Depot - jMonkeyEngine Hub) and am kinda using that as my template, but still am not connecting some dot.

hey i normaly use gl_FragCoord for fog i dont know that help or not :slight_smile:
https://playground.babylonjs.com/#Q0P9HA#1

1 Like

yeah I like that, but can you make it happen on a posteffect?

https://www.babylonjs-playground.com/#Z0I7C6

1 Like

hahah your a boss.

Now without the CustomMaterial.

All in a single pass on the postEffect?

1 Like

you need shadermaterial :)))
i realy dont make shadermaterial in last 2 years :slight_smile:
you most move to some new tools

https://www.babylonjs-playground.com/#Z0I7C6#3

https://playground.babylonjs.com/#63NSAD#5

Got it thank you freind!

https://playground.babylonjs.com/#63NSAD#8

Actually can you take a look at this and see how to fix the z contribution?

Also can you explain fogScaleLevel_1, fogScaleLevel_2, fogHeightLevel_1?

@nasimiasl

i think the best way is calc depth and Pos in the one render target and send that to Postprocess and why i say best way because the data we have in render target and postprocess is not so exact for example pos in render target is so real but in postprocess we fit it between 0-1 so and zDepth too it is good if you calc it in render target
for explain level1 and level 2 …

that is simulate the exp2 but with 3 parameters
the green line is the result of that math

i don’t get the your solution pos? we need real world pos height but you use camera.pos

hey i need similar effect but the target around the armRotatecamera should not have fog, how to do it

hi can you explain more about requirment? thanks

i need fog effect like this, around the camera we don’t need the fog and remaining space need the fog which is laying in the ground

That looks like just a linear fog, nothing special unless I am missing something or looking at the wrong scene.

just that be start fog not faster than liner i guess but that is same in far positions also that is fog for fixed position not the current camera position? am i right?
i can disable some mesh from receive fog too
you cant use the gl_FragCoord for that fog

@Krishna_Kishore
https://playground.babylonjs.com/#Q0P9HA#5

2 Likes