How to do "Fog" in particular axis?

Started by SonicBurst2, June 01, 2017, 11:44:56 PM

Previous topic - Next topic

SonicBurst2

Like for example , if I have a valley ( lets assume depth is in z axis ) , then is there a way / technique to have the fog density increasing along z axis ? So that the depth fades away .
I have checked "setFogging()"... but it's density increases along camera-view's direction.

EgonOlsen

You could do that in a shader. However, I don't quite get the point of it. Maybe I misunderstood what you want to do. You want a kind of static fogging, but fades out parts of the scene but indepent from the camera's view?

SonicBurst2

#2
    Yes, it should be independent of the camera view ,
Like ,Suppose I have a very tall tree , then when looked from above ,with an angle (Like in isometric projection type view),
I shall not be able to see the base of the tree and the ground, it simply fades away ...
I want to give a perception of extreme depth...
The existing inbuilt fogging works, but only when viewed from extreme top view angle. If I change my angle, I can see the base of my "Cliff" and the props on the top side becomes faded which are at a distance .

MichaelJPCT

i guess it is called "layered fog". it requires shader and quite much calculation.
but somtimes you can do fake fog - use a transparent plane with foggy texture.

EgonOlsen

Or you could use one of the defatul shaders (in the jpct-ae.jar) and modify it in a way that it calculates the fog based on something else but the distance from the camera.