POV-Ray : Newsgroups : povray.newusers : "Fade away" overlay for existing objects : Re: "Fade away" overlay for existing objects Server Time
3 May 2024 02:02:30 EDT (-0400)
  Re: "Fade away" overlay for existing objects  
From: William F Pokorny
Date: 23 Jun 2015 22:25:43
Message: <558a1527@news.povray.org>
On 06/23/2015 04:14 PM, severedo wrote:
> In the meantime i stumbled upon the fog feature. It does exactly what I want
> except that I can only define a plane but not really another geometry:
>
>   fog{ fog_type 2
>        distance  3
>        color     White
>        fog_offset -5.5
>        fog_alt    2.0
>        turbulence 1.8
>        up <-0.5,1,0>
>      }
>
> This would be great if I could somehow define a center point where the fog
> then starts expanding like a sphere, obscuring everything.
>
>
In addition to what has been suggested a couple other possible methods 
come to mind.

1) I've never done it, but with fog you are not limited to one use in a 
scene meaning you could declare a base fog and then instantiate several 
copies of it, rotating each variously around your "axis of clarity." Not 
sure what happens with the fog where the regions of fog overlap.

2) You could try the aoi pattern with a plane in front of the camera. I 
tried this myself just now with the code below. Simple tuning is 
possible by playing with the color map in the example, more complex 
foggy looks can be achieved by using the aoi pattern with more complex 
pigments/textures in a map. Whether enough to get the effect you really 
want not sure.

Good hunting.
Bill P.


//-------------------- fadeFromCenter.pov -----------------------
#version 3.7;
global_settings {
     assumed_gamma 1
     ambient_light srgb <1,1,1>
}
#declare Grey50 = srgbft <0.5,0.5,0.5,0,0>;
background { color Grey50 }
#declare CameraLocation = <4.50,4.50,-4.501>;
#declare CameraLookAt = <0.0,0.0,0.0>;
#declare Camera00 = camera {
     perspective
     location CameraLocation
     sky <0,1,0>
     angle 35
     right x*(image_width/image_height)
     look_at CameraLookAt
}
#declare White = srgbft <1,1,1,0,0>;
#declare Light00 = light_source { <50,150,-250>, White }
#declare Brown_Bramble = srgbft <0.349,0.1569,0.01569,0,0>;
#declare PlaneY = plane { <0,1,0>, 0
     pigment { color Brown_Bramble }
}
#include "transforms.inc"
#declare TransformToCam = transform {
     Reorient_Trans(<0.0,-1.0,0.0>,CameraLookAt-CameraLocation)
     translate CameraLocation
}
#declare PlaneCamera = plane { <0,1,0>, -1
     transform TransformToCam
}
#declare Red = srgbft <1,0,0,0,0>;
#declare CylinderX = cylinder {
     <-10,0,0>, <10,0,0>, 0.01
     pigment { color Red }
}
#declare Green = srgbft <0,1,0,0,0>;
#declare CylinderY = cylinder {
     <0,-10,0>, <0,10,0>, 0.01
     pigment { color Green }
}
#declare Blue = srgbft <0,0,1,0,0>;
#declare CylinderZ = cylinder {
     <0,0,-10>, <0,0,10>, 0.01
     pigment { color Blue }
}
#declare ColorImageCenter = srgbft <1,1,1,0,1>;
#declare ColorImageEdge = srgbft <1,1,1,0,0>;
#declare ColorMap_AOIfade = color_map {
     [ 0 ColorImageEdge ]
     [ 0.75 ColorImageEdge ]
     [ 0.975 ColorImageCenter ]
     [ 1 ColorImageCenter ]
}
#declare Pigment_AOIfade = pigment { aoi color_map { ColorMap_AOIfade }}
#declare Texture_AOIfade = texture { pigment { Pigment_AOIfade } }
#declare ObjCameraPlane = object {
     object { PlaneCamera }
     texture { Texture_AOIfade }
     hollow no_shadow
}
//---
camera { Camera00 }
light_source { Light00 }
object { CylinderX }
object { CylinderY }
object { CylinderZ }
object { PlaneY }
object { ObjCameraPlane }


Post a reply to this message

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