POV-Ray : Newsgroups : povray.general : Transparent objects and fog - bug? Server Time
5 Aug 2024 18:17:59 EDT (-0400)
  Transparent objects and fog - bug? (Message 1 to 10 of 10)  
From: Gail Shaw
Subject: Transparent objects and fog - bug?
Date: 4 Aug 2002 07:51:10
Message: <3d4d152e@news.povray.org>
I ran across something odd the other day. Is this a bug or is there a
reasonable explaination.

I have a scene with a plane, sphere, transparent  hollow box (rgbf 1) and
ground fog.
If the fog has turbulence then the box is partially visible and casts a
shadow. If the fog has
no turbulence then the box just casts a shadow. If the fog is removed then
box is not
visible and casts no shadow (this is what I would expect in all three cases)

See pics in p.b.i

Eg scene

------------

#version 3.5;
#include "colors.inc"

camera {
  location <0,0.5,-4>
  look_at <0,0,0>
  angle 40
}

fog {
 fog_type   2
 distance   10
 color      rgb 0.6
 fog_alt    10
 turbulence 0.5 // comment this line out and the box disappears
}

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

plane {
  y, -1
  pigment { color rgb <0.7,0.5,0.3> }
}

sphere {
  0, 1
  pigment {
   crackle
   color_map {
    [0.0 Red]
    [1.0 Blue]
   }
   scale 0.5
  }
  translate z*10
}

box {
 <-4,0,0>,<0,2,0.01>
 hollow
 pigment {rgbf 1}
}

----------

Gail
--
#macro G(H,S)disc{0z.4pigment{onion color_map{[0rgb<sin(H/pi)cos(S/pi)*(H<6)
cos(S/pi)*(H>6)>*18][.4rgb 0]}}translate<H-5S-3,9>}#end G(3,5)G(2,5.5)G(1,5)
G(.6,4)G(.5,3)G(.6,2)G(1,1)G(2,.5)G(3,.7)G(3.2,1.6)G(3.1,2.5)G(2.2,2.5)G(9,5
)G(8,5.5)G(7,5)G(7,4)G(7.7,3.3)G(8.3,2.7)G(9,2)G(9,1)G(8,.5)G(7,1)///GS


Post a reply to this message

From: hughes b
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 09:47:39
Message: <3d4d307b@news.povray.org>
I had to do a little redundant testing of fog itself to make sure of what I
was seeing.

I was thinking you might have had a filtered fog there, possibly due to the
color vector promoting to 5 place vector instead of only 3. That wasn't it.
Unlike your nonturbulence rendering I could still see the box itself and its
shadow so I changed some transparencies and it never did look invisible,
only more obvious if anything. I even tried moving everything out of the
negative y region and shifted the camera and objects sideways. Still the
same.

You can tell that fog is causing the box surface to appear kind of like
refraction or even reflection might do. When I added extremes of octaves,
lambda and omega, the surface would get textured by the fog. The shadow
became spotted too. Really points to a problem with only turbulence IMHO.
However I fear this thing about transparency and fog is still present, which
I had thought was fixed. I can't remember about that though.


Post a reply to this message

From: Ken
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 10:49:46
Message: <3D4D3F6E.20FE8527@pacbell.net>
hughes b wrote:

> Really points to a problem with only turbulence IMHO.
> However I fear this thing about transparency and fog is still present, which
> I had thought was fixed. I can't remember about that though.

I don't recall a bug fix for this one and it has been reported several
times in the past few years. I don't know if a fix is even possible or
if it is simply a limitation with fog and transparent objects. Sure sounds
like a VFAQ candidate if anyone knows the answer to this problem (not me).

-- 
Ken Tyler


Post a reply to this message

From: Slime
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 10:56:36
Message: <3d4d40a4$1@news.povray.org>
I'm not sure about the shadow, but the visibility of transparent objects
with fog turbulence is a known flaw. Fog turbulence isn't calculated as
accurately as media is... it's complicated, but the way it's calculated,
rays starting in different positions will think the fog has different
turbulence patterns. It's like an abrupt change in media density. There's no
easy way around it.

For the shadow, see if raising max_trace_level helps; it's possible the fog
somehow makes it shoot another ray somewhere...

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Christopher James Huff
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 12:06:19
Message: <chrishuff-2718D5.10571504082002@netplex.aussie.org>
In article <3d4d152e@news.povray.org>,
 "Gail Shaw" <gai### [at] mwebcoza> wrote:

> I have a scene with a plane, sphere, transparent  hollow box (rgbf 1) 
> and ground fog. If the fog has turbulence then the box is partially 
> visible and casts a shadow. If the fog has no turbulence then the box 
> just casts a shadow. If the fog is removed then box is not visible 
> and casts no shadow (this is what I would expect in all three cases)

The turbulence part is just a side-effect of the way fog is calculated. 
It is a "cheat" that really doesn't simulate the real world very well, 
but is fast to calculate. The turbulence is a 2D effect that depends on 
the beginning location of the ray, not a 3D variation in density which 
would require sampling like media. Not sure what's causing the shadow...

It might be possible to fix this: if the shape is non-refracting and 
totally transmitting (like a media container that shouldn't be visible), 
skip intersections with it and use the next shape out for the fog 
calculations. Wouldn't work if it or that next shape has a partially 
transparent texture or ior, but it would take care of media containers.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

From: Gail Shaw
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 13:27:53
Message: <3d4d6419@news.povray.org>
"Slime" <slm### [at] slimelandcom> wrote in message
news:3d4d40a4$1@news.povray.org...
> I'm not sure about the shadow, but the visibility of transparent objects
> with fog turbulence is a known flaw. Fog turbulence isn't calculated as
> accurately as media is... it's complicated, but the way it's calculated,
> rays starting in different positions will think the fog has different
> turbulence patterns. It's like an abrupt change in media density. There's
no
> easy way around it.

Aaah. I don't recall seeing this mentioned before, must have filed it in
file F
(for forget)

Guess the real workaround is to use media instead of fog.

> For the shadow, see if raising max_trace_level helps; it's possible the
fog
> somehow makes it shoot another ray somewhere...
>

max_trace was 3/5

Fortunatly this isn't causing too much of a problem in my current scene.
I'll try and keep it in mind in the future.

Gail
--
#macro G(H,S)disc{0z.4pigment{onion color_map{[0rgb<sin(H/pi)cos(S/pi)*(H<6)
cos(S/pi)*(H>6)>*18][.4rgb 0]}}translate<H-5S-3,9>}#end G(3,5)G(2,5.5)G(1,5)
G(.6,4)G(.5,3)G(.6,2)G(1,1)G(2,.5)G(3,.7)G(3.2,1.6)G(3.1,2.5)G(2.2,2.5)G(9,5
)G(8,5.5)G(7,5)G(7,4)G(7.7,3.3)G(8.3,2.7)G(9,2)G(9,1)G(8,.5)G(7,1)///GS


Post a reply to this message

From: Alan Holding
Subject: Re: Transparent objects and fog - bug?
Date: 4 Aug 2002 15:04:40
Message: <3d4d7ac8$1@news.povray.org>
"Gail Shaw" <gai### [at] mwebcoza> wrote in message
news:3d4d152e@news.povray.org...
> I ran across something odd the other day. Is this a bug or is there a
> reasonable explaination.

I reported a similar problem recently (see
http://news.povray.org/povray.binaries.images/21994/)

The 'bug' still appears using the full 3.5 release.

Hey ho...


Post a reply to this message

From: Warp
Subject: Re: Transparent objects and fog - bug?
Date: 6 Aug 2002 15:26:31
Message: <3d5022e7@news.povray.org>
Slime <slm### [at] slimelandcom> wrote:
> For the shadow, see if raising max_trace_level helps

  max_trace_level has no effect on shadow calculations. (Yes, this surprised
me when I first discovered this feature; but when you know the details, it's
logical.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Charles Fusner
Subject: Re: Transparent objects and fog - bug?
Date: 6 Aug 2002 18:34:39
Message: <3D504F1B.6020300@enter.net>
Alan Holding wrote:
> I reported a similar problem recently (see
> http://news.povray.org/povray.binaries.images/21994/)
> 
> The 'bug' still appears using the full 3.5 release.

Alan: This, at least, seems similar to something that cost me a full
afternoon figuring out something that I intended to finish in about
half an hour (one of those "slap you forehead when you see it" deals).

I had the following situation in my current project:

I wanted to create a piece of tattered, torn sail cloth hanging from
a mast sticking up out of the water suggestive of a sunken ship that
wasn't down very deep (kinda vaguely inspired by Myst, I admit, but for
a different application). The sail cloth was a bezier, and I was
planning to make it ripped looking by using a variant of a technique I
had used before to make tattered edges on paper: ie. an image map with
a transparent ripping pattern in the alpha channel.

Trouble was, this time I was using both fog and multi-layer media in
concentric outer spheres to emulate a stormy sky. This turned out to be
a problem (which I verified by commenting out the #include the invoked
the skies) Every time the media and fog were present, a ghost image of
the transparent portion of the sail cloth texture appeared. The bezier
had a "hollow" on it (although it seemed counter-intuitive to think of
an infinitely thin surface as "hollow"), yet... still, the problem.

Two solutions presented themselves, the latter of which I went with. I
recount them both FWIW in case they help with similar situations (like
the one you've described.)

1. I doubled the bezier, translating the duplicate slightly away from
the camera. For whatever reason, having two copies of the same surface
made the problem vanish.
2. Finally (this is the forehead slapping part) I noticed the sailcloth
was attached to the mast, which was attached to the ship body which was
a CSG union (due to its need to be rotated and translated into place)
and stuck a "hollow" on the whole CSG at the root union. Bing. The
problem ALSO went away, this time without doubling the bezier. As if
somehow the "non-hollowness" of the root union was affecting the hollow
on the bezier somehow.

Well, anyway, it worked. Hope this is useful info.

-- 
@C[$F];
The Silver Tome ::  http://www.silvertome.com
"You may sing to my cat if you like..."


Post a reply to this message

From: Alan Holding
Subject: Re: Transparent objects and fog - bug?
Date: 8 Aug 2002 19:28:17
Message: <3d52fe91@news.povray.org>
"Charles Fusner" <cfu### [at] enternet> wrote in message
news:3D5### [at] enternet...
> 2. Finally (this is the forehead slapping part) I noticed the sailcloth
> was attached to the mast, which was attached to the ship body which was
> a CSG union (due to its need to be rotated and translated into place)
> and stuck a "hollow" on the whole CSG at the root union. Bing. The
> problem ALSO went away, this time without doubling the bezier. As if
> somehow the "non-hollowness" of the root union was affecting the hollow
> on the bezier somehow.
>
> Well, anyway, it worked. Hope this is useful info.

Well, I tried both techniques and no success.  Thanks for the information
anyway, Charles.


Post a reply to this message

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