www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: SonicBurst2 on June 01, 2017, 11:44:56 pm

Title: How to do "Fog" in particular axis?
Post by: SonicBurst2 on June 01, 2017, 11:44:56 pm
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.
Title: Re: How to do "Fog" in particular axis?
Post by: EgonOlsen on June 02, 2017, 08:42:41 am
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?
Title: Re: How to do "Fog" in particular axis?
Post by: SonicBurst2 on June 02, 2017, 10:58:12 am
    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 .
Title: Re: How to do "Fog" in particular axis?
Post by: MichaelJPCT on June 05, 2017, 06:55:14 am
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.
Title: Re: How to do "Fog" in particular axis?
Post by: EgonOlsen on June 06, 2017, 07:44:33 am
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.