POV-Ray : Newsgroups : povray.newusers : Using Fog for depthcue - broken when behind transparent objects : Using Fog for depthcue - broken when behind transparent objects Server Time
13 May 2024 18:49:32 EDT (-0400)
  Using Fog for depthcue - broken when behind transparent objects  
From: Lothar
Date: 24 Feb 2014 11:20:00
Message: <web.530b6f77db6a306aabef93160@news.povray.org>
Hi,

  I am using the Fog feature to add depthcuing to a scene in povray 3.6 and the
new 3.7. For this puropse I rotate the ground fog 90 degrees so that it is
getting denser in the back and it works quite well.

However, I noticed that when I have a transparent object close to the observer
looking at some depthcued/foggy objects behind it, the fog is essentially
removed from it. This looks odd and breaks the depthueing. This refers to the
linux (CentOS 6.5) version of povray - did not try windows.

The following shows a set of red cubes with depthcuing. The right side has a
transparent triangle in front and the cubes in the back behind the triangle
appear to have the fog removed.

This is either a bug or an incorrect use of some povray feature by me. If there
is an alternative to do depthcuing please let me know.

//Start
global_settings {
  ambient_light rgb  <0.40000, 0.40000, 0.40000>
  assumed_gamma      1.800
  adc_bailout        0.00390
  max_trace_level    5
}

#declare camera_direction = < 0.0, 0.0, -1.0 >;
#declare camera_location  = < 0.0, 0.3, 3.0 >;
#declare camera_angle     = 10;
#declare camera_look_at   = < 0.0, 0.0, -1.0 >;

camera {
  location  camera_location
  right     x * 1.00000
  direction camera_direction
  angle     camera_angle
  look_at   camera_look_at
}


background { color rgb < 1.0000, 1.0000, 1.0000 > }

light_source {
   <0.0, 0, 100>
   color rgb 1
}
light_source {
   <0.0, 500, 0.1>
   color rgb 1
}

#declare Usefog = 1;
#ifdef (Usefog)
#declare DEPTH_RGB      = <1.000, 1.000, 1.000>;
  fog {
    distance   0.2424 * 8
    fog_alt    0.01
    fog_offset -1.1437 + 1
    fog_type   2
    rotate     x*90
    color rgb  DEPTH_RGB
  }
#end


#declare b = box {
  <-0.1,-0.1,-0.1>, <0.1,0.1,0.1>
}

#declare idz = 0;

#while (idz < 9 )

  object {
    b
    texture {
      pigment { color rgb <1,0,0> }
      finish { ambient 0.8 diffuse 0.3 specular 0.1 roughness 0.05 }
    }
    translate <-0.12,0.0, -idz*0.5>
  }
  object {
    b
    texture {
      pigment { color rgb <1,0,0> }
      finish { ambient 0.8 diffuse 0.3 }
    }
    translate <0.12, 0.0, -idz*0.5>
  }

  #declare idz = idz+1;
#end


#declare TrigTrans = 0.8;

triangle {

  <-1,-0.5,0>, <0.0,0.5,0.0>, <1,-0.5,0>
  translate <1.4, 0.8,0>
  scale 0.11
  rotate z*45
  texture { pigment { color rgbt <0.8, 0.8, 0.8, TrigTrans> }
            finish {ambient 0.4 diffuse 0.3 specular 0.2 roughness 0.01} }
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.