POV-Ray : Newsgroups : povray.newusers : Just testing reflection in POVRay but cannot make to work Server Time
31 Oct 2024 23:29:05 EDT (-0400)
  Just testing reflection in POVRay but cannot make to work (Message 1 to 3 of 3)  
From: Saimazoom
Subject: Just testing reflection in POVRay but cannot make to work
Date: 19 Nov 2006 12:00:00
Message: <web.45608d5520a99b7cb670dc70@news.povray.org>
Hi

 I'm not really new to POVRAY, but it is a log time since the last time I
used it(1.x) and it seems that I forgot something important, because I
cannot make this simple scene to work.

 In the scene I have a plane, and on top of the plane a pyramid with a
parallel light hitting one of the faces. I've added a translucent plane on
top of everything just to watch the reflection of the light in the side of
the pyramid going trought this second plane. But there is no reflection at
all.

 The code is as follows:

---------------------------------------------
#version 3.6

#include "colors.inc"

#declare Photons=on;

global_settings {
  assumed_gamma 1.0
  //radiosity {brightness 0.3}
  max_trace_level 5
  #if (Photons)          // global photon block
    photons {
      spacing 0.01                 // specify the density of photons
      //count 100000               // alternatively use a total number of
photons
      //gather min, max            // amount of photons gathered during
render [20, 100]
      //media max_steps [,factor]  // media photons
      //jitter 1.0                 // jitter phor photon rays
      //max_trace_level 5          // optional separate max_trace_level
      //adc_bailout 1/255          // see global adc_bailout
      //save_file "filename"       // save photons to file
      //load_file "filename"       // load photons from file
      //autostop 0                 // photon autostop option
      //radius 10                  // manually specified search radius
      // (---Adaptive Search Radius---)
      //steps 1
      //expand_thresholds 0.2, 40
    }

  #end
}

// ------------------------------------------------------------

// ... Parallel source light ...
light_source {
  <5,20,0>       // light's position
  color White      // light's color
  cylinder
  radius 20
  parallel
  point_at <5, 0, 0>      // direction of spotlight
  area_light <1, 0, 0>, <0, 0, 1>, 2, 2
  adaptive 1
  jitter
  tightness 1            // tightness of falloff (1...100) lower is softer,
higher is tighter
  falloff 1               // intensity falloff radius (outer, in degrees)
  photons {           // photon block for a light source
    refraction on
    reflection on
  }
}


// ------------------------------------------------------------

//--------------------------------------------------------- Pyramid_N macro
#macro Pyramid_N (N, Radius1, Radius2, Height)
//-------------------------------------------------------------------------
#local D= 0.00001;

intersection{
 #local Nr = 0;    // start
 #local EndNr = N; // end
 #while (Nr < EndNr)

  // linear prism in z-direction:
  prism { -2.00 ,2.00 , 5 // from z1, to z2 , number of points (first =
last)
         <-2.00, 0.00>, < 1.00,  0.00>,
         < 0.00+Radius2/Radius1,1.00>,
         <-2.00,1.00>, <-2.00, 0.00>
         rotate<-90,0,0> scale<1,1,-1> //turns prism in z direction!
         scale <Radius1+Nr*D,Height+Nr*D,Radius1+Nr*D>
         rotate<0,Nr * 360/EndNr,0>
     } // end of prism ----------------------------------------------------

 #local Nr = Nr + 1;    // next Nr
 #end // ----------------  end of loop
} // end of intersection

#end // ------------------------------------------------------ end of macro


// ------------------------------------------------------------


camera {

  location  <0,50,0>
  look_at   <0,0,0>
}


plane {
  y, 1

 texture {
    pigment { color rgb <1, 1, 1> }
  }
  photons {
  reflection on
  refraction on
  }
}


plane {
  y, 20
 texture {
    pigment { color rgbt <0, 1, 0, 0.8> }
  }
  photons {
  reflection on
  refraction on
  }
}

object {
    #Pyramid_N (4,10,0,5)
    translate <0 1 0>
    texture {
        pigment { color Blue }
    }
    finish {
    reflection { 0.5 }
    }

    photons
    {
    reflection on
    refraction on
    }
}


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


Post a reply to this message

From: Alain
Subject: Re: Just testing reflection in POVRay but cannot make to work
Date: 19 Nov 2006 13:01:15
Message: <45609beb@news.povray.org>
Saimazoom nous apporta ses lumieres en ce 19/11/2006 11:59:
> Hi

>  I'm not really new to POVRAY, but it is a log time since the last time I
> used it(1.x) and it seems that I forgot something important, because I
> cannot make this simple scene to work.

>  In the scene I have a plane, and on top of the plane a pyramid with a
> parallel light hitting one of the faces. I've added a translucent plane on
> top of everything just to watch the reflection of the light in the side of
> the pyramid going trought this second plane. But there is no reflection at
> all.

>  The code is as follows:

> ---------------------------------------------
> #version 3.6

> #include "colors.inc"

> #declare Photons=on;

> global_settings {
>   assumed_gamma 1.0
>   //radiosity {brightness 0.3}
>   max_trace_level 5
>   #if (Photons)          // global photon block
>     photons {
>       spacing 0.01                 // specify the density of photons
>       //count 100000               // alternatively use a total number of
> photons
>       //gather min, max            // amount of photons gathered during
> render [20, 100]
>       //media max_steps [,factor]  // media photons
>       //jitter 1.0                 // jitter phor photon rays
>       //max_trace_level 5          // optional separate max_trace_level
>       //adc_bailout 1/255          // see global adc_bailout
>       //save_file "filename"       // save photons to file
>       //load_file "filename"       // load photons from file
>       //autostop 0                 // photon autostop option
>       //radius 10                  // manually specified search radius
>       // (---Adaptive Search Radius---)
>       //steps 1
>       //expand_thresholds 0.2, 40
>     }

>   #end
> }

> // ------------------------------------------------------------

> // ... Parallel source light ...
> light_source {
>   <5,20,0>       // light's position
>   color White      // light's color
>   cylinder
>   radius 20
>   parallel
>   point_at <5, 0, 0>      // direction of spotlight
>   area_light <1, 0, 0>, <0, 0, 1>, 2, 2
>   adaptive 1
Adaptive don't have any effect on a 2*2 area_light. adaptive 1 don't have any 
effect unless your aray is at least 4*4, use 5*5, 9*9, 17*17 or more for best 
efficiency. A power of 2 + 1.
>   jitter
>   tightness 1            // tightness of falloff (1...100) lower is softer,
> higher is tighter
>   falloff 1               // intensity falloff radius (outer, in degrees)
>   photons {           // photon block for a light source
>     refraction on
>     reflection on
>   }
> }


> // ------------------------------------------------------------

> //--------------------------------------------------------- Pyramid_N macro
> #macro Pyramid_N (N, Radius1, Radius2, Height)
> //-------------------------------------------------------------------------
> #local D= 0.00001;

> intersection{
>  #local Nr = 0;    // start
>  #local EndNr = N; // end
>  #while (Nr < EndNr)

>   // linear prism in z-direction:
>   prism { -2.00 ,2.00 , 5 // from z1, to z2 , number of points (first =
> last)
>          <-2.00, 0.00>, < 1.00,  0.00>,
>          < 0.00+Radius2/Radius1,1.00>,
>          <-2.00,1.00>, <-2.00, 0.00>
>          rotate<-90,0,0> scale<1,1,-1> //turns prism in z direction!
>          scale <Radius1+Nr*D,Height+Nr*D,Radius1+Nr*D>
>          rotate<0,Nr * 360/EndNr,0>
>      } // end of prism ----------------------------------------------------

>  #local Nr = Nr + 1;    // next Nr
>  #end // ----------------  end of loop
> } // end of intersection

> #end // ------------------------------------------------------ end of macro


> // ------------------------------------------------------------


> camera {

>   location  <0,50,0>
>   look_at   <0,0,0>
> }


> plane {
>   y, 1

>  texture {
>     pigment { color rgb <1, 1, 1> }
>   }
>   photons {
>   reflection on
>   refraction on
>   }
> }


> plane {
>   y, 20
>  texture {
>     pigment { color rgbt <0, 1, 0, 0.8> }
>   }
>   photons {
>   reflection on
>   refraction on
>   }
> }

> object {
>     #Pyramid_N (4,10,0,5)
>     translate <0 1 0>
>     texture {
>         pigment { color Blue }
>     }
>     finish {
>     reflection { 0.5 }
>     }

>     photons
>     {
>     reflection on
>     refraction on
>     }
> }


> -----------------------------------------------------------------------

You need phong or specular in the finish, or have a look_like in the light's 
deffinition. As light_source are only abstractions, dimentionless point, from 
where light come, and not objects, they never show in reflections.
The lighter spot on the pyramid is just the spot where your cylinder light hits 
the surface, shown by rotating the pyramid. Changing the falloff will change 
it's dimention.

-- 
Alain
-------------------------------------------------
Bet my floppy's bigger than yours.


Post a reply to this message

From: Dracula Teef
Subject: Re: Just testing reflection in POVRay but cannot make to work
Date: 30 Nov 2006 16:20:00
Message: <web.456f4aad4bc32ad454b5b7910@news.povray.org>
you also have to specify your pyramid as a target of the photons:

object {
    #Pyramid_N (4,10,0,5)
    translate <0 1 0>
    texture {
        pigment { color Blue }
    }
    finish {
    reflection { 0.5 }
    }

    photons
    {
    target
    reflection on
    refraction on
    }
}


Post a reply to this message

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