POV-Ray : Newsgroups : povray.general : media question Server Time
31 Jul 2024 18:24:09 EDT (-0400)
  media question (Message 1 to 10 of 10)  
From: MichaelC
Subject: media question
Date: 18 Dec 2006 16:05:00
Message: <web.458701ac968c6bf84599c17c0@news.povray.org>
Hello fellow PoV'ers..

I am fairly new to POV-Ray and I am having issues with media and thought I
would post my question here.

I have created a stained glass window with an outside light source shining
into my room.  Without media, the light shines through and I see a colored
"shadow" on the floor from the light shining through the window.  This is
how I want it.  With media, I see the colored light shining through my
media but I lose my colored floor "shadow".

I have tried turning photons on .. but that didn't seem to help.

What do I need to get both to work?  I understand there are 3 kinds of
media, but it is frustrating trying to learn/debug media since it takes so
long to render media.  Do I need to use more than 1 type of media in the
interior?   Am I just missing a media parameter?  Do I just need to play
more with my parameters? ( no sick comments please ) More than likely this
is a simple setting I am overlooking.  I have included my light, media box
and glass texture code below.

Thanks for the help,
Michael


    light_source { <-300000,390000,250000> White*0.5
                   area_light x*1.5,z*1.5,4,4 adaptive 1
                   circular
                   media_attenuation 1
                   media_interaction 1
                 }

// media box
      box { < -Rlen, Fhei, 0   >< Rlen, Chei, Rwid+Wthi/2   >
               pigment  { rgbt 1 }
               hollow
               interior { media {  scattering { 2, 0.07
                                                extinction 0.01
                                              }
                                   samples 80, 100
                                }
                        }
            }


//Glass texture
                 texture { pigment { color Yellow
                                     transmit .5
                                     filter .8
                                   }
                                finish  { ambient 0.5
                                     diffuse 0.5
                                     reflection 0.05
                                     specular 0.25 roughness 0.01
                                   }
                         }
               }


Post a reply to this message

From: Dennis Clarke
Subject: Re: media question
Date: 18 Dec 2006 16:35:01
Message: <web.4587087dbbf3e05acd7fbef60@news.povray.org>
"MichaelC" <nomail@nomail> wrote:
> Hello fellow PoV'ers..
>
> I am fairly new to POV-Ray and I am having issues with media and thought I
> would post my question here.
>
> I have created a stained glass window with an outside light source shining
> into my room.

great idea ..

> Without media, the light shines through and I see a colored
> "shadow" on the floor from the light shining through the window.  This is
> how I want it.  With media, I see the colored light shining through my
> media but I lose my colored floor "shadow".

oh .. thats odd.

>
> I have tried turning photons on .. but that didn't seem to help.
>

can you post the complete pov source file somewhere so I can do a quick
render of it ?  Like at http://www.rafb.net/paste/

then I can look at it

I am working on something similar with glass and media etc etc

   http://www.blastwave.org/dclarke/povray_AMD64/media1_001.png

that only takes ten or fifteen minutes to render.

Dennis


Post a reply to this message

From: MichaelC
Subject: Re: media question
Date: 18 Dec 2006 16:55:01
Message: <web.45870d99bbf3e05a4599c17c0@news.povray.org>
Thanks for the reply Dennis ... Here is my code below ... and after looking
at your cool media/photon/radiosity project .... I have to say ... don't
laugh.

The media object and the media "switch" are at the end of the code

Thanks,
Michael



// ==== Standard POV-Ray Includes ====
#include "colors.inc"   // Standard Color definitions
#include "textures.inc"   // Standard Texture definitions
#include "functions.inc"  // internal functions usable in user defined
functions

global_settings { max_trace_level 100   ambient_light color White }
#declare Glass_Interior = interior { fade_distance 6 fade_power 2 }

// Draw Outside Object Switches
#declare dgrass    = 0;   #declare dsky   = 1;    #declare outsidelight = 1;

// Draw Wall Object Switches
#declare dceiling  = 1;   #declare dNwall = 1;    #declare dEwall = 1;
#declare dfloor    = 1;   #declare dSwall = 1;    #declare dWwall = 1;

#declare detail    = 0;

// Set Room Units
#declare inches = 1;      #declare foot = 12*inches;

#declare Rlen = 30*foot;  #declare Chei = 20*foot;    #declare Wthi =
10*inches;
#declare Rwid = 20*foot;  #declare Fhei = 1*inches;

// Define Cameras
#declare Cam1 = camera { perspective
                         location <0.000, 5.000, -10.000>
                         angle 70.000   // FovX < Zoom >
                         look_at < 0.000, 0.000, 0.000 >
                       }

#declare NorthCam    = camera { location <   0, (Chei-Fhei)/2,Rwid-(20*foot)
>  look_at < 30, (Chei-Fhei)/4, Rwid > angle 70 }
#declare SouthCam    = camera { location <   0, 30, 100 > look_at < 0, 30, 0
> }
#declare EastCam     = camera { location <-100, 30,   0 > look_at < 0, 30, 0
> }
#declare WestCam     = camera { location < 100, 30,   0 > look_at < 0, 30, 0
> }
//#declare TopCam      = camera { location <   0, Chei-1,  0 > look_at < 0,
0, 0 > angle Rwid }
#declare TopCam      = camera { location <   -Rlen+5, Chei/2,  0 > look_at <
0,  0, 0 > } //angle 120 }

camera { NorthCam } // Edit this line to change cameras

// END Standard declares ******************************
// START Outside **************************************

background { Blue-.5 }
#if ( dgrass ) plane { y, -1 pigment { Green } }  #end

#if ( dsky )
        #declare EarthRadius  = 6379439.6; // in meters (thus, 1 pov unit
=~= 1 m)
        #declare CloudHeight1 = 1500.0;    // in meters, still
        #declare CloudPigment = pigment { bozo
                                          turbulence 0.65
                                          octaves 6
                                          omega 0.7
                                          lambda 2
                                          color_map { [0.0 0.1 color rgb
<0.85, 0.85, 0.85> color rgb <0.75, 0.75, 0.75>]
                                                      [0.1 0.5 color rgb
<0.75, 0.75, 0.75> color rgbt <1,1,1,1>]
                                                      [0.5 1.0 color rgbt
<1,1,1,1> color rgbt <1,1,1,1>]
                                                    }
                                        }
        // Low clouds
        sphere { < 0, -EarthRadius, 0 > EarthRadius+CloudHeight1
                 pigment { CloudPigment scale 1000 }
                 finish { ambient 1 }
                 hollow
               }
        // High clouds
        sphere { < 0, -EarthRadius, 0 > EarthRadius+2*CloudHeight1
                 pigment { CloudPigment scale < 10000, 10000 ,20000 > rotate
< 310, 69, 10 > }
                 finish { ambient 1 }
                 hollow
               }
        // Fog
        fog { color Grey
              fog_type 2
              fog_alt  100
              distance 1000
            }
#end

// END Ouside *****************************************
// START Room Textures ********************************

#declare WallPigment    = pigment { brick
                                    color Grey/5,          // color of
mortar
                                    color White            // color of brick
                                    //brick_size <2*foot,1*foot,1>   // size
of brick    (optional)
                                    //mortar     1           // width of
mortar  (optional)
                                    scale 4
                                  }
#declare CeilingPigment = pigment { Yellow + Red + Tan*2 + White*2 }

#declare FloorTexture   = texture { #if ( detail )
                                          pigment { bozo
                                                    frequency .5
                                                    color_map {
                                                                [0.0 color
Gray/3 ]
                                                                [0.1 color
Gray/2 ]
                                                             //   [0.2 color
Gray ]
                                                             //   [0.6 color
Gray*2 ]
                                                                [1.0 color
White ]
                                                              }
                                                    scale 50
                                                  }
                                          normal  { bumps 8
                                                    bump_size .06
                                                    accuracy 0.2

                                                    turbulence 5
                                                  }
                                          finish  { ambient .3
                                                    diffuse 0.7
                                                    //brilliance 6
                                                    reflection 0.06
                                                    //phong 0.75
                                                    //phong_size 80
                                                    irid {
 // Iridescence (Newton's thin film interference)
                                                           0.15
 // intensity
                                                           thickness 0.25
 // film's thickness [0.0]
                                                           turbulence 0.1
 // film's thickness turbulence
                                                         }
                                                  }
                                    #else
                                          pigment { Gray }
                                    #end
                                  }

// END Room Textures **********************************
// START Drawing Room *********************************

#if (dceiling)
    box { <-Rlen-Wthi, Chei, -Rwid>, <Rlen, Chei+Wthi, Rwid>   pigment {
CeilingPigment }   }  //normal  { CeilingNormal  }     }
#end
#if (dfloor)
    box { <-Rlen, 0, -Rwid>, <Rlen, Fhei, Rwid>  texture { FloorTexture }
}
#end
#if (dSwall)
    box { < -Rlen -Wthi, Fhei, -Rwid >, < Rlen+Wthi, Chei, -Rwid-Wthi >
pigment { WallPigment }   }  //normal  { WallNormal }  }
#end
#if (dWwall)
    box { < -Rlen, Fhei, -Rwid - Wthi >, < -Rlen -Wthi, Chei, Rwid >
pigment { WallPigment }  }  //normal  { WallNormal }  }
#end
#if (dEwall)
    box { < Rlen, Fhei, Rwid >, < Rlen+Wthi, Chei, -Rwid-Wthi >    pigment {
WallPigment }   }  //normal  { WallNormal }    }
#end
#if (dNwall)
    difference { box { < -Rlen-Wthi,  Fhei, Rwid >, <Rlen+Wthi, Chei,
Rwid+Wthi >   pigment { WallPigment }  } //normal  { WallNormal }     }

                 // Cut Windows
                 box { <-1.5*foot,  2*foot, Rwid - Wthi - 1 >  < 1.5*foot,
15*foot, Rwid + Wthi + 1 >  }
             //    box { <-1.5*foot,  2*foot, Rwid - Wthi - 1 >  < 1.5*foot,
15*foot, Rwid + Wthi + 1 >    translate x*(12*foot)    }
             //    box { <-1.5*foot,  2*foot, Rwid - Wthi - 1 >  < 1.5*foot,
15*foot, Rwid + Wthi + 1 >    translate -x*(12*foot)   }
               }
#end

// END Drawing Room *************************************


//*****************************************************************************
// Define & Draw Stained Glass
//*****************************************************************************

#declare MainGlass = box { < -17.500, -80.000, -0.120 >, < 17.500, 80.000,
0.120 > }
#declare CircleGlass =  cylinder { -0.125*y,0.125*y,16.000  rotate
<90.000,0.000,0.000>   translate <0.000,10.000,0.000> }
#declare CrossGlass = merge { box { < -15.500, -3.000, -0.125 >, < 15.500,
3.000, 0.125 > translate <0.000,10.500,0.000> }
                              box { < -3.000, -25.000, -0.125 >, < 3.000,
25.000, 0.125 > }
                            }

#declare SG1 =  // Stained Glass Object
union { difference { box { < -18.000, -80.000, -0.250 >, < 18.000, 80.000,
0.250 > } // Frame
                     box { < -15.500, -77.500, -0.300 >, < 15.500, 77.500,
0.300 > }
                   }
         // Cross and Circle Frame
        union { torus { 16.000,0.300                 rotate
<90.000,0.000,0.000>  translate <0.000,10.000,0.000>  }
                cylinder { -25.000*y,25.000*y,0.300  translate
<-3.000,0.000,0.000>  }
                cylinder { -25.000*y,25.000*y,0.300  translate
<3.000,0.000,0.000>   }
                cylinder { -16.000*y,16.000*y,0.300  rotate
<0.000,0.000,90.000>  translate <0.000,7.500,0.000>    }
                cylinder { -16.000*y,16.000*y,0.300  rotate
<0.000,0.000,90.000>  translate <0.000,13.500,0.000>   }
                cylinder { -3.000*y,3.000*y,0.300    rotate
<0.000,0.000,90.000>  translate <0.000,25.000,0.000>   }
                cylinder { -3.000*y,3.000*y,0.300    rotate
<0.000,0.000,90.000>  translate <0.000,-25.000,0.000>  }
              }
        // Cut Cross Glass
        object { CrossGlass
                 texture { pigment { color Brown
                                     transmit .5
                                     filter .8
                                   }
                           finish  { ambient 0.5
                                     diffuse 0.5
                                     reflection 0.05
                                     specular 0.25 roughness 0.01
                                   }
                         }
               }
        // Cut Main Glass
        difference { object { MainGlass }
                     object { CircleGlass }
                     object { CrossGlass }
                     texture { pigment { color Violet
                                         transmit .3
                                         filter .8
                                       }
                               finish  { ambient 0.5
                                         diffuse 0.5
                                         reflection 0.05
                                         specular 0.25 roughness 0.01
                                       }
                             }
                   }
        // Cut Circle Glass
        difference { object { CircleGlass }
                     object { CrossGlass }
                     texture { pigment { color Yellow
                                         transmit .5
                                         filter .8
                                       }
                               finish  { ambient 0.5
                                         diffuse 0.5
                                         reflection 0.05
                                         specular 0.25 roughness 0.01
                                       }
                             }
                   }
      }  // End union SG1

object { SG1 translate <0,105,Rwid+Wthi/2> }

//*****************************************************************************
// Define Light Source and Media
//*****************************************************************************

#if (outsidelight)
    light_source { <-300000,390000,250000> White*0.5
                   area_light x*1.5,z*1.5,4,4 adaptive 1
                   circular
                   media_attenuation 1
                   media_interaction 1
                 }
#end

light_source { <0, Chei-20, -Rwid+Wthi   > .1     // small interior light
               media_attenuation 0
               media_interaction 0
             }


#declare dmedia    = 1;         // <<<<<<< MEDIA SWITCH

#if ( dmedia )                                    // haze media
      box { < -Rlen, Fhei, 0   >< Rlen, Chei, Rwid+Wthi/2   >
            pigment  { rgbt 1 }
            hollow
            interior { media { //absorption .4
                               scattering { 1, 0.07
                                            extinction 0.01
                                          }
                               samples 80,100      //30,100
                             }
                     }
          }
#end


Post a reply to this message

From: Dennis Clarke
Subject: Re: media question
Date: 18 Dec 2006 18:10:00
Message: <web.45871fbcbbf3e05acd7fbef60@news.povray.org>
"MichaelC" <nomail@nomail> wrote:
> Thanks for the reply Dennis ... Here is my code below ... and after looking
> at your cool media/photon/radiosity project .... I have to say ... don't
> laugh.
>
> The media object and the media "switch" are at the end of the code
>

I had to copy and paste that into an editor and then go line by line to fix
the line breaks.

Please use a paste service like pastebin or rafb.net to make life easy.

Its rendering now ...

  0:00:00 Parsing
File: ./test.pov  Line: 156
Parse Warning: No pigment type given.
File: ./test.pov  Line: 229
Parse Warning: No pigment type given.
File: ./test.pov  Line: 229
Parse Warning: No pigment type given.

  0:00:00 Creating bounding slabs
  0:00:00 Creating vista buffer
  0:00:00 Creating light buffers 10K tokens
Scene Statistics
  Finite objects:           18
  Infinite objects:          2
  Light sources:             2
  Total:                    22

Dennis


Post a reply to this message

From: MichaelC
Subject: Re: media question
Date: 18 Dec 2006 18:35:01
Message: <web.45872501bbf3e05a94b0bd780@news.povray.org>
"Dennis Clarke" <dcl### [at] blastwaveorg> wrote:
> "MichaelC" <nomail@nomail> wrote:
> > Thanks for the reply Dennis ... Here is my code below ... and after looking
> > at your cool media/photon/radiosity project .... I have to say ... don't
> > laugh.
> >
> > The media object and the media "switch" are at the end of the code
> >
>
> I had to copy and paste that into an editor and then go line by line to fix
> the line breaks.
>
> Please use a paste service like pastebin or rafb.net to make life easy.
>
> Its rendering now ...
>
>   0:00:00 Parsing
> File: ./test.pov  Line: 156
> Parse Warning: No pigment type given.
> File: ./test.pov  Line: 229
> Parse Warning: No pigment type given.
> File: ./test.pov  Line: 229
> Parse Warning: No pigment type given.
>
>   0:00:00 Creating bounding slabs
>   0:00:00 Creating vista buffer
>   0:00:00 Creating light buffers 10K tokens
> Scene Statistics
>   Finite objects:           18
>   Infinite objects:          2
>   Light sources:             2
>   Total:                    22
>
> Dennis


I apologize for the trouble.  I didn't take the line breaks into
consideration.

I hacked some older code to mock this up ... hence some of the errors, but
they didn't seem to be related to the media testing I was doing.

mlc


Post a reply to this message

From: Dennis Clarke
Subject: Re: media question
Date: 18 Dec 2006 18:45:01
Message: <web.45872724bbf3e05acd7fbef60@news.povray.org>
>
> I apologize for the trouble.  I didn't take the line breaks into
> consideration.
>
> I hacked some older code to mock this up ... hence some of the errors, but
> they didn't seem to be related to the media testing I was doing.
>

well I am surprised to say that after 30 minutes the thing is still
rendering at only 640x480 pixels.

bash-3.1$ /bin/priocntl -e -c FX -m 0 -p 0 povray -I./test.pov
-L/opt/csw/share/povray-3.6/include -W640 -H480 +X320 +B512 +Q9 +A0.3 -D +V
-O./test.png +J0.0 +GA
Persistence of Vision(tm) Ray Tracer Version 3.6.1 (CC @
i386-pc-solaris2.10)
This is an unofficial version compiled by:
 blastwave.org
 The POV-Ray Team(tm) is not responsible for supporting this version.
..
..
..
  0:32:32 Rendering line 209 of 480, 3134 supersamples

so I guess that I'll just wait a bit :-)

Dennis


Post a reply to this message

From: MichaelC
Subject: Re: media question
Date: 18 Dec 2006 18:55:00
Message: <web.45872956bbf3e05a94b0bd780@news.povray.org>
"MichaelC" <nomail@nomail> wrote:
> "Dennis Clarke" <dcl### [at] blastwaveorg> wrote:
> > "MichaelC" <nomail@nomail> wrote:
> > > Thanks for the reply Dennis ... Here is my code below ... and after looking
> > > at your cool media/photon/radiosity project .... I have to say ... don't
> > > laugh.
> > >
> > > The media object and the media "switch" are at the end of the code
> > >
> >
> > I had to copy and paste that into an editor and then go line by line to fix
> > the line breaks.
> >
> > Please use a paste service like pastebin or rafb.net to make life easy.
> >
> > Its rendering now ...
> >
> >   0:00:00 Parsing
> > File: ./test.pov  Line: 156
> > Parse Warning: No pigment type given.
> > File: ./test.pov  Line: 229
> > Parse Warning: No pigment type given.
> > File: ./test.pov  Line: 229
> > Parse Warning: No pigment type given.
> >
> >   0:00:00 Creating bounding slabs
> >   0:00:00 Creating vista buffer
> >   0:00:00 Creating light buffers 10K tokens
> > Scene Statistics
> >   Finite objects:           18
> >   Infinite objects:          2
> >   Light sources:             2
> >   Total:                    22
> >
> > Dennis
>
>
> I apologize for the trouble.  I didn't take the line breaks into
> consideration.
>
> I hacked some older code to mock this up ... hence some of the errors, but
> they didn't seem to be related to the media testing I was doing.
>

Here is a link that should work

http://home.bluemarble.net/~mcoons/POVRay/Church.htm


Post a reply to this message

From: Dennis Clarke
Subject: Re: media question
Date: 18 Dec 2006 19:30:01
Message: <web.45873215bbf3e05acd7fbef60@news.povray.org>
took 1 hour and 8 minutes to render :

    http://www.blastwave.org/dclarke/povray_AMD64/media/test.png

That doesn't look quite right now does it ?

dc


Post a reply to this message

From: Tim Attwood
Subject: Re: media question
Date: 21 Dec 2006 01:43:10
Message: <458a2cfe$1@news.povray.org>
I looked at your code...

I think you have parts of the media object in
a non-hollow object.

Parts of your scene have no texture assigned.

The sky_sphere, background and fog don't work
well with media (3.3.2.1). Use a big inverted
sphere or something for sky.

The scale of your objects is quite large, the
clouds in particular are at the edge of the
resolution of the floating point numbers in pov.
I tend to use 1 pov unit = 1 foot or so...

Here's a similar scene I made tests with...

--- Code ---
// Persistence of Vision Ray Tracer Scene Description File
// File: stained.pov
// Vers: 3.6
// Desc: a test of stained glass and media
// Date: 12/20/2006
// Auth: Tim Attwood
//

#version 3.6;

#include "colors.inc"
#include "stones.inc"

global_settings {
  assumed_gamma 1.0
}

// --- camera, lights & background ----------------------------------------

camera {
   location  <2.5, 0.7, -4.0>
   direction 1.5*z
   right     x*image_width/image_height
   look_at   <1.0, 0.0,  0.0>
}

light_source {
  <-30, 40, 30>
  color rgb <1, 1, 1>
}

light_source {
  <5, 5, -30>
  color rgb <.1, .1, 1>*0.2
  media_interaction off
}

// --- textures -----------------------------------------------------------

#declare Stained_Glass = texture {
   pigment {
      crackle solid
      color_map {
         [0 Red transmit 0.1 filter 0.8]
         [0.2 Yellow transmit 0.1 filter 0.8]
         [0.4 Blue transmit 0.1 filter 0.8]
         [0.6 Red transmit 0.1 filter 0.8]
         [0.8 Yellow transmit 0.1 filter 0.8]
         [1 Orange transmit 0.1 filter 0.8]
      }
      scale 0.2
   }
}
texture {
   pigment {
      crackle
      color_map {
         [0 Black]
         [0.02 Black]
         [0.03 Clear]
         [1 Clear]
      }
      scale 0.2
   }
};

#declare Dust = material {
    texture {
       pigment {Clear}
    }
    interior {
       media {
         scattering {
            2, 0.07 extinction 0.01
         }
         method 3
         samples 30,100
       }
    }
};

#declare Wall = texture {
   pigment {
      brick Gray50,Firebrick
      scale 0.025
   }
};

#declare Floor = texture {
    hexagon
    texture { pigment{Tan*0.9} },
    texture { pigment{Tan} },
    texture { T_Stone17 scale 3}
    scale <0.4,1,0.2>
};

// --- scene --------------------------------------------------------------

// floor
plane {y,-1 texture {Floor}}

// windows
union {
   box {<-2,0,2>,<-1,1.6,2.001>}
   box {<-0.8,0,2>,<0.2,1.6,2.001>}
   box {<0.4,0,2>,<1.4,1.6,2.001>}
   texture {Stained_Glass}
}

//wall
difference {
   box {<-10,-1,1.8>,<10,10,2.2>}
   box {<-2,0,0>,<-1,1.6,3>}
   box {<-0.8,0,0>,<0.2,1.6,3>}
   box {<0.4,0,0>,<1.4,1.6,3>}
   texture {Wall}
}

// sky
sphere {<0,0,0>,100 inverse pigment {White}}

// media object
box {
   <-2,-1,-1>,<4,1.6,1.999> hollow
   material {Dust}
}


Post a reply to this message

From: MichaelC
Subject: Re: media question
Date: 21 Dec 2006 22:25:00
Message: <web.458b4d1fbbf3e05a94b0bd780@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> I looked at your code...
>
> I think you have parts of the media object in
> a non-hollow object.
>
> Parts of your scene have no texture assigned.
>
> The sky_sphere, background and fog don't work
> well with media (3.3.2.1). Use a big inverted
> sphere or something for sky.
>
> The scale of your objects is quite large, the
> clouds in particular are at the edge of the
> resolution of the floating point numbers in pov.
> I tend to use 1 pov unit = 1 foot or so...
>

Thanks Tim,

I know my code wasn't up to par as far as textures and everything went.  I
was just using an old code block to test media with to save me some time.
Looking at the simplicity of your code though it seems it would have been
better for me to take the time to write from scratch.  My media block was
only supposed to be a box in front of the wall and windows but I think my
scale of 1U = 1 inch is a bit too much.

After looking over your code, I realized my media box went all the way down
into my floor and left no "air" for the light to reflect on the floor.  I
raised my media .001 and my filtered shadow appeared on the floor.

The simplicity of your code has made me realize that I may over complicate
things.  Nice example. Thanks again for taking the time to help out a newb.

Michael


Post a reply to this message

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