POV-Ray : Newsgroups : povray.general : Fog & media together? Server Time
25 Dec 2024 01:19:38 EST (-0500)
  Fog & media together? (Message 1 to 9 of 9)  
From: gonzo
Subject: Fog & media together?
Date: 24 May 2003 22:13:15
Message: <3ed026bb@news.povray.org>
I have some transparent spheres filled with scattering & emission media
which look fine by themselves, and I want them hovering over a scene with
ground fog in the background which also looks fine by itself, but when I
combine them the spheres aren't transparent anymore.

How can I put the spheres in the scene without the container showing?

Or how can I get a background fog that's only in the background and doesn't
interact with the foreground?

RG - curiouser and curiouser


Post a reply to this message

From: Xilo Musimene
Subject: Re: Fog & media together?
Date: 25 May 2003 09:17:13
Message: <3ED0C258.10704@hotpop.com>
gonzo wrote:
> I have some transparent spheres filled with scattering & emission media
> which look fine by themselves, and I want them hovering over a scene with
> ground fog in the background which also looks fine by itself, but when I
> combine them the spheres aren't transparent anymore.
> 
> How can I put the spheres in the scene without the container showing?
> 
> Or how can I get a background fog that's only in the background and doesn't
> interact with the foreground?

In my comprehension of the fog, it will adjust the final color of a 
pixel to the fog color based on the distance of collision between 
objects.  I think the fog cannot collision with your media inside the 
spheres, but only with the spheres themselves, thus making something 
possibly strange about the spheres.

I think, but I'm not sure at all that the only way to solve your problem 
would be to have a real atmosphere in your scene, a scene media of some 
sort, I think it's possible, I think it will solve your problem, but I'm 
not sure how well this will work.

Hope this helps at least a little!
   Xilo

-- 
Dedicated to audio/visual and interactive artwork.
http://www.geocities.com/simonlemieux/


Post a reply to this message

From: gonzo
Subject: Re: Fog & media together?
Date: 25 May 2003 17:03:27
Message: <3ed12f9f@news.povray.org>
Xilo Musimene <xil### [at] hotpopcom> wrote in message
news:3ED### [at] hotpopcom...
> In my comprehension of the fog, it will adjust the final color of a
> pixel to the fog color based on the distance of collision between
> objects.

Yes, I've been reading the docs on fog. Not what I thought it was :-(  I was
thinking it was like a generic kind of media...

I think the fog cannot collision with your media inside the
> spheres, but only with the spheres themselves, thus making something
> possibly strange about the spheres.

It appears to have no bearing on the media, any transparent object, media or
not, gives the same result. Fog apparently just doesn't understand
transparency... Bummer too, since the look of the fog was perfect.

>
> I think, but I'm not sure at all that the only way to solve your problem
> would be to have a real atmosphere in your scene, a scene media of some
> sort, I think it's possible, I think it will solve your problem, but I'm
> not sure how well this will work.

Thanks for the suggestion.  I've been playing with variations on this idea,
but a few problems...
 1) a media atmosphere still shows the spheres, and
 2) render speed is SERIOUSLY affected ( 264 pps down to 1 pps)
 3) still haven't got media to look as good as fog...

So far, the likeliest solution looks like putting more media in a container
in between the foreground & background with a y gradient density to simulate
fog.  This is still slow, but not as slow as trying to do the whole
atmosphere.  Biggest problem with this is getting a media that looks like
the fog. My best attempts so far haven't even been close :-(

Any media experts out there have a good recipe for media fog or haze?

RG - hmmm, maybe there should be an ignore_fog switch for objects...


Post a reply to this message

From: Hughes, B 
Subject: Re: Fog & media together?
Date: 26 May 2003 00:24:29
Message: <3ed196fd@news.povray.org>
I'm not at all sure if this is related to something discussed long ago but
if it is it would be due to trouble with transparency or filtered colors. I
just can't remember if a fix was attempted in 3.5 either, and if so that
making this a different problem. Or there's something else amiss in how
you're scene is done I guess.
----
Well, I checked a simple scene here and didn't see what you described. Only
thing that shows up is the shadow of the sphere, unless no_shadow is added
to remove it. Shouldn't be seeing the shadow though, ideally, so that could
be a bug still.

Here it is to try yourself:

camera {
  location  <0, .5, -3>
  right     x*image_width/image_height
  look_at   0
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0 rgb <.7,.8,.9>]
      [1 rgb <.2,.4,.8>]
    }
  }
}

light_source {<-30, 30, -30>,1}

fog {
 fog_type 2
 distance 5
 color <.8,.8,.8>
 fog_alt .5
 fog_offset -1
}

plane {y,-1 pigment {color rgb <.3,.9,.3>}}

sphere {
  0, 1
  texture {
    pigment {rgbf 1}
  }
 interior {
  media {
    emission <.6,.3,.1> // commented or uncommented, same
    absorption <.1,.3,.6> // commented or uncommented, same
   scattering { // commented or uncommented, same
    1,<.6,.3,.1>
   }
   density {
    spherical
    density_map {
     [.3 rgb 0]
     [1 rgb 1]
    }
    turbulence .5
   }
  }
 }
 hollow
// no_shadow
}


Post a reply to this message

From: Gilles Tran
Subject: Re: Fog & media together?
Date: 26 May 2003 12:49:58
Message: <3ed245b6@news.povray.org>

3ed026bb@news.povray.org...
> Or how can I get a background fog that's only in the background and
doesn't
> interact with the foreground?

Do you use turbulent fog ? It's known to cause problems with media.
Otherwise you can try using a fog that points to -z instead of up.
fog{
    fog_type 2
    fog_alt 10
    distance 30
    rgb 1
    up -z
}
The trick is useful to get a very foggy and close background (starting at
z=-fog_alt I presume) with a clear foreground. No guarantee it's going to
solve your problem though, and of course it's no longer a ground fog...

G.
--

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: gonzo
Subject: Re: Fog & media together?
Date: 26 May 2003 15:23:11
Message: <3ed2699f@news.povray.org>
Gilles Tran <tra### [at] inapginrafr> wrote in message
news:3ed245b6@news.povray.org...

> 3ed026bb@news.povray.org...
> > Or how can I get a background fog that's only in the background and
> doesn't
> > interact with the foreground?
>
> Do you use turbulent fog ? It's known to cause problems with media.

Thanks Gilles, for your input.  Yes, I'm using turbulent fog, but commenting
out the turbulence doesn't make a difference.

Unfortunately, ground fog is a necessity due to the sky and other objects in
the background... :-(

RG - well, this was going to be for a mystery IRTC entry... maybe I'll just
submit it as is and let that be my mystery...


Post a reply to this message

From: gonzo
Subject: Re: Fog & media together?
Date: 26 May 2003 15:32:34
Message: <3ed26bd2@news.povray.org>
Hughes, B. <omn### [at] charternet> wrote in message
news:3ed196fd@news.povray.org...
> I'm not at all sure if this is related to something discussed long ago but
> if it is it would be due to trouble with transparency or filtered colors.
I
> just can't remember if a fix was attempted in 3.5 either, and if so that
> making this a different problem. Or there's something else amiss in how
> you're scene is done I guess.
> ----
> Well, I checked a simple scene here and didn't see what you described.
Only
> thing that shows up is the shadow of the sphere, unless no_shadow is added
> to remove it. Shouldn't be seeing the shadow though, ideally, so that
could
> be a bug still.

Thanks for the input, Bob.  Your sample seems to work fine, so maybe I'm
doing something wrong in my code.  Here's a stripped down scene with the
media & fog I'm using...

#include "colors.inc"
#include "skies.inc"

#declare campos = <-13.5,6,-15.5>;
#declare seepos = <5,3.8,5>;

camera

    location campos
    look_at seepos
    angle 80
}
light_source { <-50,20,-10> White }
sky_sphere { S_Cloud5 }

fog {
    distance 125
    color rgbf <.550,.440,.400,.15>
    fog_type 2
    fog_offset 6.85
    fog_alt 7.1
    // turbulence .5  // doesn't make any difference
}

#declare Glow = sphere { 0, 1.3 hollow
    pigment { rgbt 1 }
    interior

        media {
            scattering {  3, <.025,.02,.002> extinction .15 }
            intervals 25
            samples 1.5,1.5
            confidence 0.98
            variance 1/1024
            density { spherical
                color_map {
                    [0.00 rgbf <.015,.005,.000, 1.00>]
                    [0.15 rgbf <.235,.115,.001, 0.80>]
                    [0.50 rgbf <.505,.425,.003, 0.60>]
                    [1.00 rgbf <.725,.580,.025, 0.15>]
                }
                scale 1.2
            }
        }
        media {
            emission <.225,.210,.055>
            density {  spherical
                color_map {
                    [0.00 rgb <.000,.000,.000>]
                    [0.10 rgb <.045,.015,.010>]
                    [0.25 rgb <.245,.135,.025>]
                    [1.00 rgb <.485,.280,.035>]
                }
                turbulence .65
            }
        }
    }
    no_shadow
    // inverse  // on or off doesn't make any difference
}

#declare E_Light = light_group

    light_source { <.2,0,.2> rgb <1.2, 1, .95> fade_power 11 fade_distance
1.5}
    object { Glow }
}
#declare Spook = union {
    object { E_Light }
    light_source { <0,0,0> rgb<.65,.5,.1> fade_power 1.9 fade_distance 9 }
}

object { Spook scale 3 translate y*7 }  // lights on...
// object { Glow scale 3 translate y*7 } // lights off (doesn't make a
difference)

plane { y .1 pigment { rgb <.6,.7,.1> } }

// eof

My lighting is different, but that doesn't seem to have any bearing.  If
I've done something blatantly stupid in my code, feel free to point it out.
:-)

RG


Post a reply to this message

From: Gilles Tran
Subject: Re: Fog & media together?
Date: 26 May 2003 18:19:26
Message: <3ed292ee@news.povray.org>

3ed26bd2@news.povray.org...
> Hughes, B. <omn### [at] charternet> wrote in message
> news:3ed196fd@news.povray.org...

>     color rgbf <.550,.440,.400,.15>

It's the filter in the fog that's causing it. In fact it has nothing to do
with media... The transparent sphere with no media shows the problem too.
Remove the filter or replace it with transmit and it disappears.

G.


--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: gonzo
Subject: Re: Fog & media together?
Date: 26 May 2003 21:45:09
Message: <3ed2c325@news.povray.org>
Gilles Tran <git### [at] wanadoofr> wrote in message
news:3ed292ee@news.povray.org...

> 3ed26bd2@news.povray.org...
> > Hughes, B. <omn### [at] charternet> wrote in message
> > news:3ed196fd@news.povray.org...
>
> >     color rgbf <.550,.440,.400,.15>
>
> It's the filter in the fog that's causing it. In fact it has nothing to do
> with media... The transparent sphere with no media shows the problem too.
> Remove the filter or replace it with transmit and it disappears.
>

Yep, that's it. Saw that after I looked at Bob's sample.  It does seem to
change the look of the fog slightly, but I'm sure I can adjust.

Thanks all!

RG - here's how good you guys are... although this is only the 3rd or 4th
time I've posted a question here, this was actually about my 50th question
for this group, except usually the answer comes to me as I'm typing in the
question!


Post a reply to this message

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