FOG and transparent plane with water texture

Started by LowPolyMan, April 21, 2013, 11:14:55 PM

Previous topic - Next topic

LowPolyMan

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]

EgonOlsen

#1
"all the time" is a bit vague. Can you be precise, please?

LowPolyMan

#2
Quote from: EgonOlsen on April 22, 2013, 03:41:54 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

EgonOlsen

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


water = Primitives.getPlane(10, 900);


already improves it.