POV-Ray : Newsgroups : povray.binaries.images : isosurface lighting problem. Server Time
18 Nov 2024 00:25:35 EST (-0500)
  isosurface lighting problem. (Message 1 to 6 of 6)  
From: Hasan3
Subject: isosurface lighting problem.
Date: 29 Dec 2005 06:10:00
Message: <web.43b3c38c82977d8aa1148aa80@news.povray.org>
I tested difference methot with various object. All object's surface is
illuminated but isosurface object is not. is this a bug? (All object's
texture is same)
Hasan
Regards.


Post a reply to this message


Attachments:
Download 'picture1.jpg' (33 KB)

Preview of image 'picture1.jpg'
picture1.jpg


 

From: Josh
Subject: Re: isosurface lighting problem.
Date: 29 Dec 2005 06:46:22
Message: <43b3cc8e$1@news.povray.org>
Did all the objects have a texture applied, I've seem similar this if there 
one object without a texture.


Post a reply to this message

From: Hasan3
Subject: Re: isosurface lighting problem.
Date: 29 Dec 2005 07:40:01
Message: <web.43b3d8ec719b68fca1148aa80@news.povray.org>
"Josh" <s### [at] acom> wrote:
> Did all the objects have a texture applied, I've seem similar this if there
> one object without a texture.

Josh , Obje2 and Object4 are isosurface. And  have a same texture. Source
code :



global_settings {
  max_trace_level 5
  assumed_gamma 1.2
  ambient_light rgb 0

}

#include "colors.inc"
#include "shapes.inc"
#include "functions.inc"

  //*camera //--------------------------------------------------------------
    camera {
            perspective
            location  <2.36351653729229,6.93219315555339,-6.80013009112446>
            look_at   <11.7789531128032,3.12385465710533,5.38224681168665>
    }




//*Işık
//--------------------------------------------------------------
//------------------------------------------------------------------------
  light_source {<-3.93798798921654,28.3416665636843,-14.8981105229398>
        color rgb <1,1,1>*3
  }


 #declare mat_white =
  texture {
    pigment {  color rgb <0.1,0.5,0.3>}

    finish{
            ambient 0.5
            diffuse 0.7
    }
  }


#declare Obje1=
   box
{<8.07895311280318,0,7.58224681168665>,<12.5099417562586,3.12385465710533,-0.143131111903111>
   texture {mat_white}
 }




#declare Obje3=
   prism {
      linear_sweep
      linear_spline
        0,
        0.8,
         9,
       <1.6,0.6>,
       <3.5,0.4>,
       <5.8,0.8>,
       <7.6,0.5>,
       <5.6,0.6>,
       <3.4,0.2>,
       <1.7,0.4>,
       <9.99999999999996E-02,-0.1>
       <0,0>
 translate <8.4,0.465846756827856,7.8>

  texture {mat_white}
  Rotate_Around_Trans(-x*90,<8.4,0.465846756827856,7.8>)
  Rotate_Around_Trans(-y*-90,<8.4,0.465846756827856,7.8>)

}

#declare Obje2=
//---------------Isosurface--------------------------------------
   isosurface {
         function {sqrt(x*x + y*y + z*z) - 1 + f_noise3d(x*8, y*8,z*8)*0.25}
         threshold 0
         contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
         accuracy   0.001
         max_gradient 4
         scale  <1.05,0.45,0.95>
         texture {mat_white}
         translate <8.52895311280318,3.15932827355748,-0.193131111903108>
 }

#declare Obje4=
//---------------Isosurface--------------------------------------
   isosurface {
     function {sqrt(x*x + y*y + z*z) - 1 + f_noise3d(x*8, y*8,z*8)*0.25}
     threshold 0
     contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
     accuracy   0.001
     max_gradient 4
     scale  <0.3,0.2,3>
     texture {mat_white}
     translate <8.07895311280318,3.04726354996945,2.75686888809689>
  }

#declare Obje5=
 sphere {
   <8.28069185181685,2.94789039307405,7.28398555070032>
   0.58309518948453
   texture {mat_white}
}

#declare Obje6=
 sphere {
   <12.0806918518169,2.94789039307405,-1.60144492996793E-02>
   0.58309518948453
   texture {mat_white}
}

#declare Obje7=
 sphere {
   <10.3806918518169,2.94789039307405,-0.216014449299679>
   0.58309518948453
   texture {mat_white}
 }

#declare Obje8=
 cylinder {
   <10.4,1.47427676948369,-0.2>, <10.4,-0.125723230516308,-0.2>,
0.282842712474619
   texture {mat_white}
  }
#declare Obje9=
   box {<7.9,0,0.4>,<8.5,2,-0.4>
   texture {mat_white}
 }


difference {
 object {Obje1}
 object {Obje2}
 object {Obje3}
 object {Obje4}
 object {Obje5}
 object {Obje6}
 object {Obje7}
 object {Obje8}
 object {Obje9}
}


Post a reply to this message

From: Bob Hughes
Subject: Re: isosurface lighting problem.
Date: 29 Dec 2005 08:37:13
Message: <43b3e689@news.povray.org>
Try adding the keyword all_intersections to each isosurface statement. This 
will help because external objects are being used with the isosurfaces.

I checked your script and I believe it also renders correctly if the 
isosurface keyword max_trace is used, with a value of only 2. Instead, 
all_intersections simply continues to look for those surfaces whereas 
max_trace limits that search to what you specify.

Bob


Post a reply to this message

From: Hasan3
Subject: Re: isosurface lighting problem.
Date: 29 Dec 2005 09:00:00
Message: <web.43b3eb35719b68fca1148aa80@news.povray.org>
"Bob Hughes" <omniverse@charter%net> wrote:
> Try adding the keyword all_intersections to each isosurface statement. This
> will help because external objects are being used with the isosurfaces.
>
> I checked your script and I believe it also renders correctly if the
> isosurface keyword max_trace is used, with a value of only 2. Instead,
> all_intersections simply continues to look for those surfaces whereas
> max_trace limits that search to what you specify.
>
> Bob


Hmm,
Bob thanks. This keyword solve this problem.
Best Regards.
Hasan


Post a reply to this message


Attachments:
Download 'picture2.jpg' (53 KB)

Preview of image 'picture2.jpg'
picture2.jpg


 

From: Alain
Subject: Re: isosurface lighting problem.
Date: 30 Dec 2005 12:34:00
Message: <43b56f88@news.povray.org>
Hasan3 nous apporta ses lumieres en ce 2005-12-29 07:39:
> "Josh" <s### [at] acom> wrote:
> 
>>Did all the objects have a texture applied, I've seem similar this if there
>>one object without a texture.
> 
> 
> Josh , Obje2 and Object4 are isosurface. And  have a same texture. Source
> code :
> 
> 
> 
> global_settings {
>   max_trace_level 5
>   assumed_gamma 1.2
>   ambient_light rgb 0
> 
> }
> 
> #include "colors.inc"
> #include "shapes.inc"
> #include "functions.inc"
> 
>   //*camera //--------------------------------------------------------------
>     camera {
>             perspective
>             location  <2.36351653729229,6.93219315555339,-6.80013009112446>
>             look_at   <11.7789531128032,3.12385465710533,5.38224681168665>
>     }
> 
> 
> 
> 
> //*Işık
> //--------------------------------------------------------------
> //------------------------------------------------------------------------
>   light_source {<-3.93798798921654,28.3416665636843,-14.8981105229398>
>         color rgb <1,1,1>*3
>   }
> 
> 
>  #declare mat_white =
>   texture {
>     pigment {  color rgb <0.1,0.5,0.3>}
> 
>     finish{
>             ambient 0.5
>             diffuse 0.7
>     }
>   }
> 
> 
> #declare Obje1=
>    box
>
{<8.07895311280318,0,7.58224681168665>,<12.5099417562586,3.12385465710533,-0.143131111903111>
>    texture {mat_white}
>  }
> 
> 
> 
> 
> #declare Obje3=
>    prism {
>       linear_sweep
>       linear_spline
>         0,
>         0.8,
>          9,
>        <1.6,0.6>,
>        <3.5,0.4>,
>        <5.8,0.8>,
>        <7.6,0.5>,
>        <5.6,0.6>,
>        <3.4,0.2>,
>        <1.7,0.4>,
>        <9.99999999999996E-02,-0.1>
>        <0,0>
>  translate <8.4,0.465846756827856,7.8>
> 
>   texture {mat_white}
>   Rotate_Around_Trans(-x*90,<8.4,0.465846756827856,7.8>)
>   Rotate_Around_Trans(-y*-90,<8.4,0.465846756827856,7.8>)
> 
> }
> 
> #declare Obje2=
> //---------------Isosurface--------------------------------------
>    isosurface {
>          function {sqrt(x*x + y*y + z*z) - 1 + f_noise3d(x*8, y*8,z*8)*0.25}
>          threshold 0
>          contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
>          accuracy   0.001
>          max_gradient 4
>          scale  <1.05,0.45,0.95>
>          texture {mat_white}
>          translate <8.52895311280318,3.15932827355748,-0.193131111903108>
>  }
> 
> #declare Obje4=
> //---------------Isosurface--------------------------------------
>    isosurface {
>      function {sqrt(x*x + y*y + z*z) - 1 + f_noise3d(x*8, y*8,z*8)*0.25}
>      threshold 0
>      contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
>      accuracy   0.001
>      max_gradient 4
>      scale  <0.3,0.2,3>
>      texture {mat_white}
>      translate <8.07895311280318,3.04726354996945,2.75686888809689>
>   }
> 
> #declare Obje5=
>  sphere {
>    <8.28069185181685,2.94789039307405,7.28398555070032>
>    0.58309518948453
>    texture {mat_white}
> }
> 
> #declare Obje6=
>  sphere {
>    <12.0806918518169,2.94789039307405,-1.60144492996793E-02>
>    0.58309518948453
>    texture {mat_white}
> }
> 
> #declare Obje7=
>  sphere {
>    <10.3806918518169,2.94789039307405,-0.216014449299679>
>    0.58309518948453
>    texture {mat_white}
>  }
> 
> #declare Obje8=
>  cylinder {
>    <10.4,1.47427676948369,-0.2>, <10.4,-0.125723230516308,-0.2>,
> 0.282842712474619
>    texture {mat_white}
>   }
> #declare Obje9=
>    box {<7.9,0,0.4>,<8.5,2,-0.4>
>    texture {mat_white}
>  }
> 
> 
> difference {
>  object {Obje1}
>  object {Obje2}
>  object {Obje3}
>  object {Obje4}
>  object {Obje5}
>  object {Obje6}
>  object {Obje7}
>  object {Obje8}
>  object {Obje9}
> }
> 
A slighr imporvement suggestion: when all elements of a CSG object share the same
texture, it's 
preferable to apply the texture to the whole rather than to each individual
components.
Tha advantages are that the texture deffinition is only present once, saving some
memory (this can 
prevent swapping in very complex scenes). It's also easier to maintain and make
cleaner code (easier 
to read). Can be somewhat faster to parse and render.

-- 
Alain
-------------------------------------------------
42.7 percent of all statistics are made up on the spot.


Post a reply to this message

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