POV-Ray : Newsgroups : povray.general : Why are these "invisible" spheres visible? Server Time
28 Nov 2024 02:52:07 EST (-0500)
  Why are these "invisible" spheres visible? (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: gadoid
Subject: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 16:15:00
Message: <web.46e05e106d67f0f14e9a00c00@news.povray.org>
The code below generates five spheres which should be invisible, yet three
of them are visible from their interaction with the environment.  The
spheres become visible when you apply a rotation to a texture that uses a
texture_map  containing clear (rgbt <1,1,1,1>) components as in the
T_Electron texture below.  If the texture is not rotated, then the sphere
remains invisible.  Rotation applied to a clear texture not part of a
texture_map also remains invisible.

It also seems to be the case that the surface behind the spheres must have a
"normal" for the effect to occur.  The effect goes away if you remove the
"normal" block in the texture of the  "floor".

I realize the T_Electron texture as written below is pretty pointless, but
in the actual scene I am trying to create, not all of the texture map is
clear. The intent was to create a spherical shell of lightning with parts
of the texture_map representing the lightning, and the rest clear.  The
problem I am having is the the clear portions affecting the appearance of
objects behind it.  I removed the "lightning" portion for this example.

I am using povray 3.6

#include "colors.inc"

#declare T_Clear = texture {pigment { Clear }}

#declare T_Electron =
  texture {
    crackle
    texture_map {
        [0.00   T_Clear]
        [1.00   T_Clear]
    }
  }

//
// Three of these spheres are visible (those at x positions -1,
// 0 and 1).
//
sphere { <-1,1,0>,   0.2 hollow texture { T_Electron rotate 90*y }}
sphere { <-0.5,1,0>, 0.2 hollow texture { T_Electron rotate 0*y }}
sphere { <0,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}
sphere { <0.5,1,0>,  0.2 hollow texture { T_Clear rotate 90*y }}
sphere { <1,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}


plane { y, 0
  texture {
    pigment {
      checker
      Red
      White
      scale 0.05
    }
    normal { bozo 4}
  }
}

light_source {
  <-8.0,   6,   -10>
  color rgb 2
}

camera {
  //
  // New Main view
  //
  look_at <0,1,0>
  location <0,1.5,-2>

  up <0,1,0>
}


Post a reply to this message

From: Alain
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 16:47:11
Message: <46e0674f$1@news.povray.org>
gadoid nous apporta ses lumieres en ce 2007/09/06 16:11:
> The code below generates five spheres which should be invisible, yet three
> of them are visible from their interaction with the environment.  The
> spheres become visible when you apply a rotation to a texture that uses a
> texture_map  containing clear (rgbt <1,1,1,1>) components as in the
> T_Electron texture below.  If the texture is not rotated, then the sphere
> remains invisible.  Rotation applied to a clear texture not part of a
> texture_map also remains invisible.
> 
> It also seems to be the case that the surface behind the spheres must have a
> "normal" for the effect to occur.  The effect goes away if you remove the
> "normal" block in the texture of the  "floor".
> 
> I realize the T_Electron texture as written below is pretty pointless, but
> in the actual scene I am trying to create, not all of the texture map is
> clear. The intent was to create a spherical shell of lightning with parts
> of the texture_map representing the lightning, and the rest clear.  The
> problem I am having is the the clear portions affecting the appearance of
> objects behind it.  I removed the "lightning" portion for this example.
> 
> I am using povray 3.6
> 
> #include "colors.inc"
> 
> #declare T_Clear = texture {pigment { Clear }}
> 
> #declare T_Electron =
>   texture {
>     crackle
>     texture_map {
>         [0.00   T_Clear]
>         [1.00   T_Clear]
>     }
>   }
> 
> //
> // Three of these spheres are visible (those at x positions -1,
> // 0 and 1).
> //
> sphere { <-1,1,0>,   0.2 hollow texture { T_Electron rotate 90*y }}
> sphere { <-0.5,1,0>, 0.2 hollow texture { T_Electron rotate 0*y }}
> sphere { <0,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}
> sphere { <0.5,1,0>,  0.2 hollow texture { T_Clear rotate 90*y }}
> sphere { <1,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}
> 
> 
> plane { y, 0
>   texture {
>     pigment {
>       checker
>       Red
>       White
>       scale 0.05
>     }
>     normal { bozo 4}
>   }
> }
> 
> light_source {
>   <-8.0,   6,   -10>
>   color rgb 2
> }
> 
> camera {
>   //
>   // New Main view
>   //
>   look_at <0,1,0>
>   location <0,1.5,-2>
> 
>   up <0,1,0>
> }
> 
> 
> 
> 
> 
Strange. After playing with the rotation, it apears that the effect is affected 
by the amount of the rotation, as well as the axis of the rotation. At rotation 
90, 60 and 30 give me the most effect.

-- 
Alain
-------------------------------------------------
Coming soon: Windows for Nintendo!


Post a reply to this message

From: gadoid
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 17:10:00
Message: <web.46e06bcec3c951274e9a00c00@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
>
> Strange. After playing with the rotation, it apears that the effect is affected
> by the amount of the rotation, as well as the axis of the rotation. At rotation
> 90, 60 and 30 give me the most effect.
>
> --
> Alain
> -------------------------------------------------
> Coming soon: Windows for Nintendo!


It also seems to be the case that the effect remains even if you rotate the
object itself instead of the texture.


Post a reply to this message

From: Chris B
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 17:37:08
Message: <46e07304$1@news.povray.org>
"gadoid" <hansen at tkgate.org> wrote in message 
news:web.46e05e106d67f0f14e9a00c00@news.povray.org...
> The code below generates five spheres which should be invisible, yet three
> of them are visible from their interaction with the environment.  The
> spheres become visible when you apply a rotation to a texture that uses a
> texture_map  containing clear (rgbt <1,1,1,1>) components as in the
> T_Electron texture below.  If the texture is not rotated, then the sphere
> remains invisible.  Rotation applied to a clear texture not part of a
> texture_map also remains invisible.
>
> It also seems to be the case that the surface behind the spheres must have 
> a
> "normal" for the effect to occur.  The effect goes away if you remove the
> "normal" block in the texture of the  "floor".
>
> ... snip ...
>
> #declare T_Clear = texture {pigment { Clear }}
>
> #declare T_Electron =
>  texture {
>    crackle
>    texture_map {
>        [0.00   T_Clear]
>        [1.00   T_Clear]
>    }
>  }
>
> ... snip ...
> sphere { <0,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}
>

I'm taking a bit of a guess here, but maybe it relates to using a texture 
that only contains a pigment for a crackle texture map. It looks a bit to me 
like the sphere is acquiring a crackle normal. If you define T_Clear and 
T_Electron as pigments and use a pigment_map the problem seems to go away. 
If this is the cause though, I don't know why your texture would go clear at 
a zero and 180 degree rotation around y.

Regards,
Chris B.


Post a reply to this message

From: gadoid
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 18:10:00
Message: <web.46e07a2dc3c951274e9a00c00@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote:
> "gadoid" <hansen at tkgate.org> wrote in message
> news:web.46e05e106d67f0f14e9a00c00@news.povray.org...
> > The code below generates five spheres which should be invisible, yet three
> > of them are visible from their interaction with the environment.  The
> > spheres become visible when you apply a rotation to a texture that uses a
> > texture_map  containing clear (rgbt <1,1,1,1>) components as in the
> > T_Electron texture below.  If the texture is not rotated, then the sphere
> > remains invisible.  Rotation applied to a clear texture not part of a
> > texture_map also remains invisible.
> >
> > It also seems to be the case that the surface behind the spheres must have
> > a
> > "normal" for the effect to occur.  The effect goes away if you remove the
> > "normal" block in the texture of the  "floor".
> >
> > ... snip ...
> >
> > #declare T_Clear = texture {pigment { Clear }}
> >
> > #declare T_Electron =
> >  texture {
> >    crackle
> >    texture_map {
> >        [0.00   T_Clear]
> >        [1.00   T_Clear]
> >    }
> >  }
> >
> > ... snip ...
> > sphere { <0,1,0>,    0.2 hollow texture { T_Electron rotate 90*y }}
> >
>
> I'm taking a bit of a guess here, but maybe it relates to using a texture
> that only contains a pigment for a crackle texture map. It looks a bit to me
> like the sphere is acquiring a crackle normal. If you define T_Clear and
> T_Electron as pigments and use a pigment_map the problem seems to go away.
> If this is the cause though, I don't know why your texture would go clear at
> a zero and 180 degree rotation around y.
>
> Regards,
> Chris B.

Hmmm.  It seems to me to be more of a refraction-like effect, and changing
"crackle" to anything else does not change the way it renders.  I've placed
an image at http://www.tkgate.org/povray/electrons.png (this is a test shot
for a larger scene) that has the problem in it.   When you look through the
clear portion of the "electrons", you can see that the  waves seem shifted
as though the sphere had an 'ior' in it.  The "electrons" in this image are
made with an internal shiny metal sphere, and a co-located larger sphere
with the T_Electron texture to get the lightning cage effect.  If I don't
rotate the "electrons", the clear portion behaves and does not cause a
problem.

This is the actual texture I am using:

#declare P_ElectricBlue = pigment { color  rgb <0.178, 0.122, 1> };

#declare T_Lightning =
  texture {
    pigment { P_ElectricBlue }
    finish {
      ambient 5
      brilliance 100.0
    }
  }


#declare T_Clear =
texture { pigment { Clear }}

#declare T_Electron =
  texture {
    //    gradient y
    crackle
    turbulence .3
    texture_map {
      [0.000 T_Lightning ]
      [0.0400 T_Lightning ]
      [0.0800 T_Clear ]
      [0.00 T_Clear ]
      [1.00 T_Clear ]

    }
    scale 0.1
  }


Post a reply to this message

From: Chris B
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 20:01:16
Message: <46e094cc$1@news.povray.org>
"gadoid" <hansen at tkgate.org> wrote in message 
news:web.46e07a2dc3c951274e9a00c00@news.povray.org...
>
> Hmmm.  It seems to me to be more of a refraction-like effect, and changing
> "crackle" to anything else does not change the way it renders.  I've 
> placed
> an image at http://www.tkgate.org/povray/electrons.png (this is a test 
> shot
> for a larger scene) that has the problem in it.   When you look through 
> the
> clear portion of the "electrons", you can see that the  waves seem shifted
> as though the sphere had an 'ior' in it.
>

Well I've tried a whole load of things and I'm still not able to see exactly 
what's causing it.
I don't think it's refraction because the background (e.g. the checkered 
plane) is not distorted in any way.

I've done a small animation, rotating the sphere and it looks like clouds of 
darkness and extra brightness are passing over the surface of the sphere as 
it rotates, though the clouds don't seem to be rotating with the sphere. 
When the sphere is above the checkered plane it starts as transparent at 0 
degrees, becomes most perturbed at 90 degrees and becomes clear again at 180 
degrees of rotation.

When the sphere is embedded halfway into a checkered plane the outer shell 
goes transparent at 0 and 180 degrees still, but at 180 degrees the normals 
from the part of the surface of the plane within the sphere appear reversed. 
ie the ones that have only passed through the front surface of the sphere. 
Indeed, if at 180 degrees the normal values are reversed each time the ray 
passes through the surface of the sphere, it would explain why the rays 
passing through both the front and back surfaces appear normal.

I'm not sure if any of this helps, but I thought I'd share my findings 
before switching off for the night.

Regards,
Chris B.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 21:45:00
Message: <web.46e0ac59c3c951275e73ab330@news.povray.org>
"gadoid" <hansen at tkgate.org> wrote:
....

I may have narrowed the problem down for you.  It appears to be affected
ultimately by the size of the normals of the plane behind the spheres.

Try removing the plane normal or making it smaller and see what happens.  It
doesn't matter what normal type you have on the spheres, so it's not related
to the crackle pattern.  Whatever is causing it, the normals on the plane
appear to be getting reversed by the spheres.  For example try rendering
with "bozo 4" normal on the plane and then "bozo -4" and compare.

Hope this can help someone track down the reason or bug causing it.

-tgq


Post a reply to this message

From: Tim Attwood
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 22:14:55
Message: <46e0b41f$1@news.povray.org>
This is wierd.  Somehow the normal of the
plane is being rotated by the clear spheres.
Must be some sort of bug. =(

The effect goes away if you remove the
normal from the plane.

Try this as a replacement...

#local cpig = pigment{checker Red*1.7 White*1.7 scale 0.05};
#local bpig = pigment{Black};
plane {y, 0 texture{pigment{bozo pigment_map{[0 cpig][1 bpig]}}}}


Post a reply to this message

From: gadoid
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 22:25:00
Message: <web.46e0b422c3c9512797e3bb420@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "gadoid" <hansen at tkgate.org> wrote:
> ....
>
> I may have narrowed the problem down for you.  It appears to be affected
> ultimately by the size of the normals of the plane behind the spheres.
>
> Try removing the plane normal or making it smaller and see what happens.  It
> doesn't matter what normal type you have on the spheres, so it's not related
> to the crackle pattern.  Whatever is causing it, the normals on the plane
> appear to be getting reversed by the spheres.  For example try rendering
> with "bozo 4" normal on the plane and then "bozo -4" and compare.
>
> Hope this can help someone track down the reason or bug causing it.
>
> -tgq

I did notice the problem only happens when the surface beyond has a normal.
You are right that it may be reversing the normal, I at first thought it was
just shifting it.  I'm beginning to think that this must be a POV-Ray bug,
but if it is, I need to find a work-around for my scene.  I can't get rid
of the "normal" on the surface behind the object, because that is water and
I am using the normal to generate the waves.  I have hundreds of the
"electron" objects in the scene.  The only thing I can think of is to
#declare a different object for every orientation I need since the
unrotated objects seem to render fine.


Post a reply to this message

From: Alain
Subject: Re: Why are these "invisible" spheres visible?
Date: 6 Sep 2007 22:57:15
Message: <46e0be0b$1@news.povray.org>
gadoid nous apporta ses lumieres en ce 2007/09/06 22:23:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
>> "gadoid" <hansen at tkgate.org> wrote:
>> ....
>>
>> I may have narrowed the problem down for you.  It appears to be affected
>> ultimately by the size of the normals of the plane behind the spheres.
>>
>> Try removing the plane normal or making it smaller and see what happens.  It
>> doesn't matter what normal type you have on the spheres, so it's not related
>> to the crackle pattern.  Whatever is causing it, the normals on the plane
>> appear to be getting reversed by the spheres.  For example try rendering
>> with "bozo 4" normal on the plane and then "bozo -4" and compare.
>>
>> Hope this can help someone track down the reason or bug causing it.
>>
>> -tgq
> 
> I did notice the problem only happens when the surface beyond has a normal.
> You are right that it may be reversing the normal, I at first thought it was
> just shifting it.  I'm beginning to think that this must be a POV-Ray bug,
> but if it is, I need to find a work-around for my scene.  I can't get rid
> of the "normal" on the surface behind the object, because that is water and
> I am using the normal to generate the waves.  I have hundreds of the
> "electron" objects in the scene.  The only thing I can think of is to
> #declare a different object for every orientation I need since the
> unrotated objects seem to render fine.
> 
> 
> 
> 
> 
> 
> 
Don't rotate the texture! Instead, create the objects at the origin, rotate the 
objects, thanslate them to the final position. As you are using spheres, 
rotating the object or the texture will wave the same final aspect, minus the 
normal alteration.

In my tests, the effect depends on the axis of rotation relative to the 
camera-object vector. An object with a z rotation just in front of the default 
camera show no effect, while the same object shifted up/down or lateraly will 
exibit the effect.

-- 
Alain
-------------------------------------------------
When you don’t know what to do, walk fast and look worried.


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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