www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: LowPolyMan on April 21, 2013, 11:14:55 pm

Title: FOG and transparent plane with water texture
Post by: LowPolyMan on April 21, 2013, 11:14:55 pm
Hi there,

I have a terrain with a 50% transparent plane and a water texture.

Without using fog the water looks as it should, but when using fog the water texture changes all the time.

See screenshot.



[attachment deleted by admin]
Title: Re: FOG and transparent plane with water texture
Post by: EgonOlsen on April 22, 2013, 03:41:54 pm
"all the time" is a bit vague. Can you be precise, please?
Title: Re: FOG and transparent plane with water texture
Post by: LowPolyMan on April 22, 2013, 10:27:50 pm
"all the time" is a but vague. Can you be precise, please?

Yeah a but vague :-)

I will try to make a little demonstration source so you can see what i mean or i make a simple video.

Here i made a sample.

https://www.dropbox.com/s/f1obr9fjul9n8s5/HelloWorld_01.zip (https://www.dropbox.com/s/f1obr9fjul9n8s5/HelloWorld_01.zip)
Title: Re: FOG and transparent plane with water texture
Post by: EgonOlsen on April 23, 2013, 08:02:19 pm
Thanks for the test case. The reason for this behaviour is that fogging is implemented as a per vertex effect in most chips. The fog intensity will be calculated per vertex only and depends on the distance of that vertex from the camera. When rotating the plane, this distance changes and the larger the plane, the more effect does this have on the fog intensity (simply because the distance changes are big). YOu can improve this by triangulate the water plane. For example this

Code: [Select]
water = Primitives.getPlane(10, 900);

already improves it.