I need this vertical fog shader converted from threejs to babylonjs (latest) code.
In addition, I will also need a typescript BJS implementation done (playground works too).
Basically looking for the same result that can be found in the link below, but written with babylon instead of three.
Hi there and thanks for the warm welcome!
The effect you compiled looks great however it’s not what I’m looking for.
If you check out the threejs version you will see what I mean.
It makes use of RTT and is basically a shader material that is assigned to a plane mesh which you can then shift around the scene, thus getting a vertical fog effect.
The orange blocks are just there for the demo, their material is not updated.
Hey there and thanks a lot for these useful Playground links however this is not what I’m looking for in terms of end results.
Please take a minute and check out the threejs example so you can better understand what I mean.
I am not looking to replace any materials on meshes in the environment but rather create a Plane mesh to which I assign this ‘Directional Fog’ shader material in order to obtain the desired effect.
Ok I see. Sorry for misunderstanding.
I think what you want is a custom post process : Playground
That way you can code your own VertexShader + FragmentShader and apply the whole scene regardless of any other materials on meshes
That way you can take into account any direction for the fog, input a mesh coordintate as parameter, or whatever
Hah if only it were this simple!
Using particle systems was one of my original attempts.
I gave it up due to the particle textures clipping into scene geometry. (PG)
Thanks, I get what you did with the ‘top’ vector and this is definitely a good start!
Is there an easy way to make this shader output a “rectangular” fog rather than a circular one like it does now?