POV-Ray : Newsgroups : povray.newusers : how to render a transparent cube : Re: how to render a transparent cube Server Time
28 Sep 2024 17:55:08 EDT (-0400)
  Re: how to render a transparent cube  
From: chenfanfu jiang
Date: 30 Dec 2011 03:30:00
Message: <web.4efd75cef1937dc6e9c69f4b0@news.povray.org>
Thank you very much!
I am using v3.6. I changed the code according to your advice. The new rendering
result has some strange white light regions on the jello surface. How can I get
rid of that? (I can see it does not appear when I change ior to 1.0).

Also, if you could please look at the sample image
(http://s7.postimage.org/g4a0ahgrf/Untitled.png) again, you can see very shiny
effect inside it. I'm also wondering how to get a photon mapping like that? I
can tell it is not a result of scattering media.

Thanks again!
Current code:

#version 3.6;

#include "colors.inc"

global_settings {
    assumed_gamma 1
    max_trace_level 30
    adc_bailout 0.01
    photons {
        count 20000
    }
}

background { Gray50 }

#declare LIGHT_FADING_DIST = 1;

light_source {
     < 0, 10,  -3>  rgb 45
     fade_distance LIGHT_FADING_DIST fade_power 2
     area_light x,z 17,17 adaptive 2
     jitter
     circular orient
}

plane {
    y, -3
    pigment { color Gray50 }
    finish { reflection 0.35}
}

camera {
    location  <0, 1., -2>
    look_at   <0,0,  0>
}

#declare jello=
difference {
    box { <-0.5,-0.5,-0.5>, <0.5,0.5,0.5> }

    union {
        sphere {<5.47349,0,0>, 5.02349}
        sphere {<-5.47349,0,0>, 5.02349}
        sphere {<0,5.47349,0>, 5.02349}
        sphere {<0,-5.47349,0>, 5.02349}
        sphere {<0,0,5.47349>, 5.02349}
        sphere {<0,0,-5.47349>, 5.02349}
    }

   rotate y*25

    texture {

        pigment{rgbt 1}

        finish {
            phong 1 phong_size 30
            reflection{0.01, 0.9 fresnel}
        }
    }

    interior {
        ior 1.4
        fade_color Red
        fade_distance 0.33
        fade_power 1001
    }
}

object {
    jello

    photons {
        target
        reflection on
        refraction on
    }
}



Alain <aze### [at] qwertyorg> wrote:

> >
> > Thank you for the reply!
> > Here is my code, I have modified it but the result still looks weird.
> >
> I added this as I use version 3.7:
> #version 3.7;
> MUST be the first statement.
>
> > #include "colors.inc"
> > #include "shapes.inc"
> > #include "textures.inc"
> > #include "glass.inc"
> >
> >
> > global_settings {
> >      assumed_gamma 2.2
> You should use assumed_gamma 1 to get acurate results.
> Set file_gamma to 2.2 OR srgb (if using version 3.7) in povray.ini
>
> >      max_trace_level 5
> You realy need a larger value.
> I used this:
> max_trace_level 30
> adc_bailout 0.01
>
> and got trace level of 27/30.
> Some of the lines you see are caused by reatching max_trace_level to soon.
>
> >
> >      photons {
> >          count 20000
> >      }
> OK
> > }
> >
> > #declare LIGHT_FADING_DIST = 20.0;
> Excessively long. I'd use something like 1 and increase the light's
> intensity as needed.
> Idealy, for a point light, it should be something like 1e-5 and a light
> intensity in the millions. A value of 1 is a good compromise.
> For an area_light, it should be the sixe of the light.
>
> >
> > background { Gray50 }
> >
> Why do you use 4 lights? Especialy in the testing phase, one light
> should be enough.
> I tested with this one replacing your first and commented out the other 3:
>
> #declare LIGHT_FADING_DIST = 1;
>
> light_source {
>      < 0, 10,  -3>  rgb 45
>      fade_distance LIGHT_FADING_DIST fade_power 2
> }
>
> > light_source {
> >      <  0, 4,  0>  color Gray60
> >      fade_distance LIGHT_FADING_DIST fade_power 2
> >
> >      photons {
> >          reflection on
> >          refraction on
> >      }
>
> This photons block is not needed as you use the default one for any
> light_source.
>
> > }
> >
> > light_source {
> >      <  10, 4,  10>  color Gray60
> >      fade_distance LIGHT_FADING_DIST fade_power 2
> >
> >      photons {
> >          reflection on
> >          refraction on
> >      }
> > }
> >
> > light_source {
> >      <  -10, 4, 10>  color Gray60
> >      fade_distance LIGHT_FADING_DIST fade_power 2
> >
> >      photons {
> >          reflection on
> >          refraction on
> >      }
> > }
> >
> > light_source {
> >      <  0, 0, -20>  color Gray80
> >      fade_distance LIGHT_FADING_DIST fade_power 2
> >
> >      photons {
> >          reflection on
> >          refraction on
> >      }
> > }
> >
> >
> >
> > plane {
> >      y, -3
> >      pigment { color Gray50 }
> >      finish { reflection 0.35}
> > }
> Personaly, I prefer to use variable reflection for anything that is not
> a mirror.
>
> >
> > camera {
> >      location<2, 1.5, -2>
> >      look_at<0,0,  0>
> >
> > }
> >
> > #declare jello=
> > difference {
> >      box {<-0.5,-0.5,-0.5>,<0.5,0.5,0.5>  }
> >
> >      union {
> >          sphere {<5.47349,0,0>, 5.02349}
> >          sphere {<-5.47349,0,0>, 5.02349}
> >          sphere {<0,5.47349,0>, 5.02349}
> >          sphere {<0,-5.47349,0>, 5.02349}
> >          sphere {<0,0,5.47349>, 5.02349}
> >          sphere {<0,0,-5.47349>, 5.02349}
> >      }
> >
> >      //rotate y*45
> >      rotate x*45
> >
> >      texture {
> >
> >          pigment { Red filter .98 }
>
> Would be beter to use pigment{rgbt 1}
> pigment{rgbt 0.98} is also acceptable.
> The pigment in in the mass, not at the surface.
>
> >
> >          finish {
> >              phong 1 phong_size 30
> >              reflection 0.01
>
> That reflection is totaly unrealistic. You should use variable
> reflection with the fresnel option:
> reflection{0.01, 0.9 fresnel}
>
> >          }
> >      }
> >
> >      interior {
> >          ior 1.34
> >          fade_color Red
> >          fade_distance 10
>
> Shorten this to about 0.2 to 0.4
> I got good looking result using 0.33
>
> fade_distance is the key parameter to controll the intensity of fading
> interior.
>
> >          fade_power 1001
> >      }
> > }
> >
> > object {
> >      jello
> >
> >
> >      photons {
> >          target
> >          reflection on
> >          refraction on
> >      }
> > }
> >
> >
> >
>
> Your original render used an area_light. Probably the one from the
> include menu. It's array, at 4 by 4, is realy to sparce, and with the
> use of jitter, lead to some very grainy penumbrae. Without jitter, you
> get strong banding.
>
> You should use a much higher density and add adaptive.
> I commonly use this:
> area_light x,z 17,17 adaptive 0 //for testing, may need adaptive 1 or 2.
> I often also use circular orient to simulate a spherical light_source.
>
> This area_light can be about as fast as the one from the include menu.
>
>
>
> Alain


Post a reply to this message

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