POV-Ray : Newsgroups : povray.general : transparent sphere with image_map on surface Server Time
5 Nov 2024 05:20:50 EST (-0500)
  transparent sphere with image_map on surface (Message 1 to 5 of 5)  
From: Massimo
Subject: transparent sphere with image_map on surface
Date: 11 Mar 2009 13:45:01
Message: <web.49b7f7791f4f45d54bd662900@news.povray.org>
Hello all POV experts
I'm a new user and wold like to create a "glass" sphere with an image on the
surface.
Wandering here and there and reading the documentation, I succeeded in creating
the below added code. It would be nice, apart from the reflection of the bitmap
to the back of the inner surface giving unwanted reflections.
You see I added two image_maps on the front and on the back, shifted 180 deg. to
see in transparency the back of the bitmap on the other side.
Reflection are a catastrophe!!!! What couuld I do? any suggestion?
Thank You
Massimo

Attached the code I used

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

sky_sphere { S_Cloud3 }

camera {
  location <0, 2, -5>
  look_at <0,0, 0>
}

light_source {
  <0, -12, 10>
  color White
  shadowless
  }
light_source {
  <0, 0, -10>
  color White
  shadowless
  }

sphere{ <0,0,0>, 1
  texture{ pigment { color rgbf <0.9, 0.9, 0.9, 0.8> } // transparent sphere
  finish {
        reflection 0.2
        refraction 1.0
        ior 1
        phong 0.4
          }
               } // end of texture 1
  texture{ pigment{
                image_map{ gif "POV-Ray_215.gif"
                        map_type 0
                        once
                        filter all 1
                          }
                 translate<-0.5,-0.2>
                 scale<2.5,1>*0.7
           } // end pigment
  } // end of texture 2
  texture{ pigment{
                image_map{ gif "POV-Ray_215.gif"
                        map_type 0
                        once
                        filter all 1
                          }
                 translate<-0.5,-1>
                 scale<2.5,1>*0.7
                 rotate<0,180,0>
           } // end pigment
  } // end of texture 3
} // end of sphere  ------------------


Post a reply to this message

From: Cousin Ricky
Subject: Re: transparent sphere with image_map on surface
Date: 11 Mar 2009 18:15:00
Message: <web.49b8366169fc1a9c85de7b680@news.povray.org>
"Massimo" <ban### [at] gmailcom> wrote:
> Hello all POV experts
> I'm a new user and wold like to create a "glass" sphere with an image on the
> surface.
> Wandering here and there and reading the documentation, I succeeded in creating
> the below added code. It would be nice, apart from the reflection of the bitmap
> to the back of the inner surface giving unwanted reflections.
> You see I added two image_maps on the front and on the back, shifted 180 deg. to
> see in transparency the back of the bitmap on the other side.
> Reflection are a catastrophe!!!! What couuld I do? any suggestion?

Three things I noticed immediately, which aren't part of the problem, but which
you may want to take care of down the line:

- I was not aware that refraction and ior were allowed in a finish
  block.  These are probably holdovers for backwards compatibility,
  and should be moved or eliminated.

- ior belongs in an interior block, but even so, ior 1 has no effect.
  Specifically, 1 is the IOR of a vacuum, and is POV-Ray's default.

- I don't know what refraction 1.0 does in this context.  In a photon
  { target } block, it activates refraction caustics, but since you
  have no global_settings { photons{} } block, it would have no effect.

Also recommend global_settings { assumed_gamma 1 }, which will brighten up your
scene considerably.

________________________


Very little of what you are seeing is reflection.  An image map extends forever
along the  z-axis in both directions, so even with reflection 0.0 and no 2nd
image map, you'd see the image map on both the near and far surfaces of the
sphere.  With the 2nd image map, you get the quad effect that you're seeing.

Two solutions you may want to consider are:

- Use an object pigment to clip the image map to one side of the x-y
  plane.

     #declare Base_pigment = pigment
     {  object
        {  plane { z, 0 }
           pigment { rgbt 1 }
           pigment
           {  image_map
              {  gif "POV-Ray_215.gif"
                 map_type 0 once filter all 1
              }
           }
        }
     }

  Then use Base_pigment in place of your current image_map block.

- Use u-v mapping.  If you choose this method, you should not rotate
  the image map, but scale and translate in the x directions.


Post a reply to this message

From: clipka
Subject: Re: transparent sphere with image_map on surface
Date: 11 Mar 2009 21:20:00
Message: <web.49b8626c69fc1a9c801985dd0@news.povray.org>
Maybe "inside_texture" will get you where you want to go, allowing you to
specify a different reflectance for inside and outside.

> sphere{ <0,0,0>, 1
>   texture{ pigment { color rgbf <0.9, 0.9, 0.9, 0.8> } // transparent sphere
>   finish {
>         reflection 0.2
>         refraction 1.0
>         ior 1
>         phong 0.4

Some additional (unsolicited) advice:

- "refraction" is actually not necessary; it's just a relic from old times (I
wonder where you got that from; it's not even mentioned in the online help
anymore as far as I can tell). The amount of refracted light is nowadays
controlled by the transmit & filter components of the pigment.

- For a realistic glass sphere, set ior to 1.3; the default value of 1 doesn't
do any refraction at all.

- use specular instead of phong (more realistic; AFAIK phong only takes into
account the position of the light source, while specular takes into account
both light source and camera position)


Post a reply to this message

From: Massimo
Subject: Re: transparent sphere with image_map on surface
Date: 12 Mar 2009 07:30:01
Message: <web.49b8f17769fc1a9c4bd662900@news.povray.org>
ThankYou all


Post a reply to this message

From: Alain
Subject: Re: transparent sphere with image_map on surface
Date: 12 Mar 2009 16:32:35
Message: <49b97163$1@news.povray.org>
Massimo nous illumina en ce 2009-03-11 13:40 -->
> Hello all POV experts
> I'm a new user and wold like to create a "glass" sphere with an image on the
> surface.
> Wandering here and there and reading the documentation, I succeeded in creating
> the below added code. It would be nice, apart from the reflection of the bitmap
> to the back of the inner surface giving unwanted reflections.
> You see I added two image_maps on the front and on the back, shifted 180 deg. to
> see in transparency the back of the bitmap on the other side.
> Reflection are a catastrophe!!!! What couuld I do? any suggestion?
> Thank You
> Massimo
> 
> Attached the code I used
> 
> #include "colors.inc"
> #include "skies.inc"
> 
> sky_sphere { S_Cloud3 }
> 
> camera {
>   location <0, 2, -5>
>   look_at <0,0, 0>
> }
> 
> light_source {
>   <0, -12, 10>
>   color White
>   shadowless
>   }
> light_source {
>   <0, 0, -10>
>   color White
>   shadowless
>   }
> 
> sphere{ <0,0,0>, 1
>   texture{ pigment { color rgbf <0.9, 0.9, 0.9, 0.8> } // transparent sphere
>   finish {
>         reflection 0.2
>         refraction 1.0
>         ior 1
>         phong 0.4
>           }
>                } // end of texture 1
>   texture{ pigment{
>                 image_map{ gif "POV-Ray_215.gif"
>                         map_type 0
>                         once
>                         filter all 1
>                           }
>                  translate<-0.5,-0.2>
>                  scale<2.5,1>*0.7
>            } // end pigment
>   } // end of texture 2
>   texture{ pigment{
>                 image_map{ gif "POV-Ray_215.gif"
>                         map_type 0
>                         once
>                         filter all 1
>                           }
>                  translate<-0.5,-1>
>                  scale<2.5,1>*0.7
>                  rotate<0,180,0>
>            } // end pigment
>   } // end of texture 3
> } // end of sphere  ------------------
> 
> 
> 
> 
> 
> 
Another way to map your image is to use the warp.
   texture{ pigment{
                 warp{spherical image_map{ gif "POV-Ray_215.gif"

                         once
                         filter all 1
                           }}
                  translate<-0.5,-0.2>
                  scale<2.5,1>*0.7
            } // end pigment
With "once" it will only apears once on the surface. Without it, it will get 
tilled. You use the scale command to adjust the area the image will cover. 
Without scale, it will go from one pole to the other and meet itself on the 
back. Scale<0.25, 0.5, 1> will restrict it within 45 degree up and down and 90 
degree around.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you look at a matrix transform and 
know instantly what it does.
John VanSickle


Post a reply to this message

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