Author Topic: FOG and transparent plane with water texture  (Read 2220 times)

Offline LowPolyMan

  • byte
  • *
  • Posts: 25
    • View Profile
FOG and transparent plane with water texture
« 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]
« Last Edit: April 21, 2013, 11:18:35 pm by LowPolyMan »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: FOG and transparent plane with water texture
« Reply #1 on: April 22, 2013, 03:41:54 pm »
"all the time" is a bit vague. Can you be precise, please?
« Last Edit: April 22, 2013, 11:18:40 pm by EgonOlsen »

Offline LowPolyMan

  • byte
  • *
  • Posts: 25
    • View Profile
Re: FOG and transparent plane with water texture
« Reply #2 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
« Last Edit: April 23, 2013, 03:50:16 pm by LowPolyMan »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: FOG and transparent plane with water texture
« Reply #3 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.