POV-Ray : Newsgroups : povray.general : IOR + dispersion - help : IOR + dispersion - help Server Time
5 Aug 2024 22:20:57 EDT (-0400)
  IOR + dispersion - help  
From: Rafal 'Raf256' Maj
Date: 21 Jul 2002 13:38:00
Message: <Xns9252C72634CC5raf256com@204.213.191.226>
Hi,
I have problem with my scene. I posted here full source and link to images.

Problem is with glass texture. Everything is o.k., until I add dispersion.
I want to get nice rainbow (photons+dispersion). But adding dispersion 
makes glass very dark, even at pigment color rgbf 1 (without dispersion it 
is totaly clear ofcourse).

Is there some way to add filter to dispersion effect ? btw. how can I get 
rid of that yellow sircle around lower-right part of glass ?
IMHO it would be good idea to allow setting diffrent dispersion that is 
used to calculate glass color, and diffrent to calcualate photons.

How can I both have nice rainbow photons on gray bacground, and have very 
clear glass (like color rgbf .99)

With    dispersion  http:\\www.raf256.com\t\a4_1.jpg 
Without dispersion  http:\\www.raf256.com\t\a4_2.jpg 


Most important - glass material :

---8<-------------------------------------------------------------
    texture {
      pigment { color rgbf 1 /*<.93,.98,.999, .98>*/ }
      finish { 
        specular .8 roughness 0.001
        //phong 0.4 phong_size 140
        reflection { .03 .11 }
        diffuse .60
        ambient 9
      }
    }  
    interior { 
      ior 1.70 fade_power 1 fade_distance 50
      dispersion 1.4 dispersion_samples QQ_Disp //  <== PROBLEM
    } 
---8<-------------------------------------------------------------
DD_Disp is 6..60 - it makes no important change.



Full source (a4.pov) You can copy/paste it, it only needs file "a.inc" - 
look at end of this post
---8<-------------------------------------------------------------

/*
  P-111 MGlass (scan) buton (class A) 

  1:1 ratio
  started 20.07.2002, last ver 0.50 21.07.2002 for 3.5win

   ,-,
  /o  \
 |     |
  \   /.
   '-'\\
       \\
        \\
         \\
*/



#declare QQ_Rad = 0; // 0,1,2   3,4,5 light sphere
#declare QQ_Phot = 1.00; // 0=off   n.=spacing lower is better  good 0.1  
//final 0.04

#declare QQ_Disp = 0.10 * 60; // dispersion samples

#declare QO_BackGr = 1;
#declare OF_MGlass = 1;
#declare CfgBackgrTest=0;

#declare CfgAreaSize=4000;
#declare CfgCamRotate =<0,0,0>;
#declare CfgCamRotateP=<0,0,20>;

//plane { z,35 pigment { checker color rgb 0 color rgb 1 }  scale 2 }

#declare objGlass = union {
  #declare matGlass = material {
    texture {
      pigment { color rgbf 1 /*<.93,.98,.999, .98>*/ }
      finish { 
        specular .8 roughness 0.001
        //phong 0.4 phong_size 140
        reflection { .03 .11 }
        diffuse .60
        ambient 9
      }
    }  
    interior { 
      ior 1.70 fade_power 1 fade_distance 50
      dispersion 1.4 dispersion_samples QQ_Disp
    }  
  }
  
  #declare matMetall = material {
    texture {
      pigment { color rgb .9 }
      finish { specular 0.9 roughness 0.010 reflection { .1 .3 metallic } 
        diffuse .85 
      }
    }    
  }
  
  #declare matHandleWood = material {
    texture {
      #declare _c1 = <1.00,0.70,0.55> * 0.70;
      #declare _c2 = <1.00,0.80,0.65> * 0.95;
      #if (1)
      pigment { wood rotate x*90 scale .08 turbulence .05 translate 12
        color_map{ 
          [0.00 color rgb _c1]
          [0.30 color rgb _c1]
          [0.70 color rgb _c2]
          [1.00 color rgb _c2] 
        }
      } #else pigment { color rgb 1 } #end
      normal { wood rotate x*90 scale .08 turbulence .05 translate 12 }
      finish { 
        specular .6 roughness 0.03 
        phong 0.6 phong_size 20
        brilliance 1.3 diffuse 0.85 
      }
    }
  }
  
  
  #declare _R = 5.2 ;        // glass radius
  #declare _RTh = 0.45;      // ring around glass R-Thickness
  #declare _RRo = _R+_RTh/2; // radius of Ring - outer
  #declare _RRi = _R-_RTh/2; // radius of Ring - inner
  #declare _RH = 0.7;  // ring (metal) height
  
  intersection { // main GLASS
    sphere { -z*10 12 }
    sphere { +z*10 12 }
    cylinder { -z*100, +z*100, _R }
    material { matGlass }
    photons{ reflection on  refraction on target }
  }      
  
  // ring around glass
  union{
    difference {
      cylinder { -z*_RH, +z*_RH,     _RRo }
      cylinder { -z*(_RH+.1), +z*(_RH+.1), _RRi }    
    }
    torus { _R _RTh/2 rotate x*90 translate +z*_RH }
    torus { _R _RTh/2 rotate x*90 translate -z*_RH }
    
    material { matMetall }
    photons{ reflection on  refraction off target }
  }
  
  // Hand   
  #declare objHand = union {
    //cone { 0, 1, -y*8, 1 }
    sor {
      9
      <1.00  ,-1>
      <1.00,0>
      <0.90,0.50>
      <1.00,1.50>
      <1.10,3.00>
      <1.10,4.50>
      <1.05,6.00>      
      <1.00,8.00>
      <1.00,9.50>
      sturm
      scale <1,-1,1>
    }
    sphere { -y*8 1 }    
    
    scale 0.93*<1.25, 1.25, 0.9>
    translate -y*_R
    material { matHandleWood }
  }
  
  object { objHand }
  
  rotate x*5
  rotate z*40
  scale 3.2
  translate z*100
  translate <-13,13,0>
// translate z*100
// translate <-10,10,0>
}

object { objGlass }

#include "a.inc"


---8<-------------------------------------------------------------
some lines with comments may word-arp, so this file is alsow on
http:\\www.raf256.com\t\a4.pov
http:\\www.raf256.com\t\a4.txt (same file just different extension)


NEEDED INCLUDE FILE -  a.inc  containing radiosity / photons settings and 
background plane is here :
http:\\www.raf256.com\t\a.inc
http:\\www.raf256.com\t\a.txt (same file just different extension)



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

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