POV-Ray : Newsgroups : povray.newusers : stbenge Fastprox fast SSS Server Time
8 Jul 2024 10:14:49 EDT (-0400)
  stbenge Fastprox fast SSS (Message 1 to 10 of 27)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Mr
Subject: stbenge Fastprox fast SSS
Date: 15 Aug 2009 17:15:01
Message: <web.4a8724829cb450a21c8336ca0@news.povray.org>
I am trying to use Fast SSS 2 from Stbenge macro but can't manage to get an
ordinary finish with it. any specularity seems to cover up the effect. Here is
what I tried By directly modifying example files from around here (I modified
Object 2):

/*















*/

//#include"shapes.inc"
//#include"shapes2.inc"
//#include"functions.inc"
//#include"math.inc"
#include"transforms.inc"
//#include"my_materials.inc"
#declare R=seed(005);

#declare global_illumination = on;
global_settings{
 #if(global_illumination=1)
  radiosity{
   //count 200 error_bound .1
   //count 9 error_bound .05
   //count 15 error_bound .002
   //count 30 error_bound .002
   count 90 error_bound .005
   //count 150 error_bound .002
   //count 130 error_bound .15
   //count 90 error_bound .2
   //count 256 error_bound .0125
   //count 309 error_bound .101
   //count 150 error_bound .05
   //count 900 error_bound .05
   //count 1600 error_bound .1
   //count 1600 error_bound .01
   //error_bound .05 count 1600/8
   //pretrace_start .08 pretrace_end .01

   //minimum_reuse .01


   nearest_count 1

   recursion_limit 1
   normal on
   brightness 1
   gray_threshold 0

   adc_bailout 0.1
  }
 #end


 //assumed_gamma 2.2
 //assumed_gamma 1
 //photons{spacing .005 jitter 1}//jitter 0 radius 1}
 photons{count 10000 jitter 0}
 max_trace_level 30

 noise_generator 3
}

#default{ finish{ambient 0 }}//normal{bumps .5 scale .0001}}

//#default{ finish{ambient 1 diffuse 0 } }//normal{bumps .5 scale .001}}

#declare cpos=<0,-9,-30>;

camera{
 //fisheye
 //right x*4/3 up y*1
 //orthographic
 //right x up y
 //right x*0.7 up y*0.7
 location<0,10,-20>*1.2
 look_at 0
 angle 10

 //aperture 5 focal_point -z*4 blur_samples 100 variance 0
 //sky<-.3,1,0>
}

//#version unofficial megapov  1.21;
/*
#declare illusion_angle = 40;
#declare illusion_image = "sky_maker3.tga"
#declare illusion_location = <0,-9,-30>;
#declare illusion_look_at = y/1.5;
#declare illusion_right=x;
#declare illusion_up=y;

#include "illusion.inc" #declare txtr=2;

#declare illusion_texture=
texture{
 pigment{illusion}
 finish{ambient 1 diffuse 0}
}
sphere{0,1000
 texture{illusion_texture}
 no_shadow
}

*/
//#include"edge_pigment.inc" #declare txtr=1;


#declare res = 5;
#declare lpos = <.5,1,-.5>*10;
#declare lcol = 1.25;
#declare earthy = <.75,.65,.5>;
#declare wooden = <.75,.5,.25>;
#declare air = <.05 .25 .5>;
#declare plant= <.4 .75 .4>;


//fog{rgb(air*4+lcol)/8 distance 1000 fog_type 2 fog_alt 150 fog_offset 0}

// 1209 1166
// 604  583

#declare area_illuminate = on;
light_source{lpos*100000,lcol }//area_light x*15000,z*15000,res,res jitter
adaptive 1 }
//light_source{lpos*100000,lcol }//area_light x*250000,z*250000,res,res jitter
adaptive 1 area_illumination area_illuminate}
//light_source{<-1,.5,.5>*100000,(air+lcol/2)  }//area_light
x*245000,z*245000,res,res jitter adaptive 2 area_illumination area_illuminate}

//light_source{lpos*100000,lcol area_light x*150000,y*150000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<0,1,0>*100000,.5 }//area_light x*250000,z*250000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<1,1,0>*100000,lcol/3 area_light x*150000,z*150000,res,res jitter
adaptive 2 area_illumination area_illuminate}
//light_source{<0,0,0>,<1,.8,.5> fade_power 2 fade_distance 15 area_light
x*1,y*1,res,res jitter adaptive 2 area_illumination area_illuminate}


//fog{rgb (air+lcol) distance 700 fog_type 2 fog_alt 10 fog_offset 0}


sky_sphere{
 pigment{
  spherical scale 2 translate y
  //warp{turbulence .05 lambda 2.75}
  Point_At_Trans(lpos)
  poly_wave 1
  //cubic_wave
  pigment_map{
   //[0 rgb earthy -.3]
   [0 rgb 0]
   [.5 rgb air]
   /*[.75
    granite scale 3.5 //turbulence .03 lambda 4
    color_map{
     [0 rgb air]
     [1 rgb 1]
    }
   ]
   */
   //[.7 rgb(air+lcol)/2]

   [1 rgb lcol]
  }
 }
}

#declare obj1=
merge{
 cylinder{-x,x,.3}
 cylinder{-y,y,.2}
 cylinder{-y,y*.8,.2 translate -z*.3}
 cylinder{-y,y*.8,.2 translate z*.3}
 cylinder{-z,z,.3}
 box{-.5,.5}
 torus{1,.125}
 rotate y*35 rotate-x*12
 translate x*-1.2
}

#declare obj2 =  object{obj1 translate x*2.4}

#include"fast_prox.inc"

#declare p1=
 pigment{
   fastSSS2(obj1,lpos,min_extent(obj1)-0.5,max_extent(obj1)+0.5,<5,5,5>,2,20)
   cubic_wave
 }

 #declare p2=
 pigment{
   fastSSS2(obj2,lpos,min_extent(obj2)-0.5,max_extent(obj2)+0.5,<5,5,5>,2,20)
   cubic_wave
 }

//****** subsurface scattering (SSS) grey textured object (on the left of the
picture) - texture shows where light passes through object (white = lots of
light passes through, black = no light passes through)
object{obj1
 pigment{p1 }
 finish{ambient 1 diffuse 0}
 //pigment{rgb 1}
}

//****** SSS plastic textured object (on the right of the picture) - the lighter
areas are more transmittant looking
object{obj2
 pigment{p2 colour_map{
                [0 rgb <0.63, 0.25, 0.15>*0.1 ]
                [1 rgb <0.63, 0.25, 0.15> ]
        }
 }
 finish {
        diffuse 0.1
        ambient 0.7
        phong 0.35
        phong_size 1
        brilliance 4
        specular 0.1
        roughness 0.01
 }
 //pigment {colour rgb <0.5,0.6,0.4>}

 //pigment{rgb 1}
}

/*
#declare fp=function{pigment{p}}

isosurface{
 function{
  fp(x,y,z).grey-.5
 }
 accuracy .01
 max_gradient 8
 contained_by{box{-1.25,1.25}}
 pigment{rgb 1}
 rotate y*35
}
*/
//sphere{0,(Max.x-Min.x)/2 pigment{rgbt .5}}

/*
union{
#declare V=0;
#while(V<=1)
 sphere{<Min.x+V*(Max.x-Min.x),0,0>,.1}
 sphere{<0,Min.y+V*(Max.y-Min.y),0>,.1}
 sphere{<0,0,Min.z+V*(Max.z-Min.z)>,.1}
 #declare V=V+incre;
#end
pigment{rgb .5}
}
*/
//box{Min,Max pigment{rgbt .5}}



//#include"edge_pigment.inc" //edge_pigment(obj, rad,jitter,quality)
//#include"stbHexPatterns.inc"
//#declare g=(1+sqrt(5))/2; // the golden ratio
//#include"luminous bloom/circular.inc"
//#include"edge_pigment.inc"
//#include"chamfered_shapes1.inc"


/*
#declare V=0;
#while(V<1)
 #declare V=V+1/10;
#end
*/

Any idea on how to integrate that macro in a custom material?


Post a reply to this message

From: Mr
Subject: Re: stbenge Fastprox fast SSS
Date: 19 Aug 2009 06:10:01
Message: <web.4a8bce666629da5e72869e8c0@news.povray.org>
Nobody?


Post a reply to this message

From: Tim Attwood
Subject: Re: stbenge Fastprox fast SSS
Date: 22 Aug 2009 23:43:48
Message: <4a90baf4$1@news.povray.org>
> Nobody?

I think that macro uses radiosity, maybe you should 
look into the SSS feature in the beta version.


Post a reply to this message

From: clipka
Subject: Re: stbenge Fastprox fast SSS
Date: 23 Aug 2009 03:11:00
Message: <4a90eb84@news.povray.org>
Mr schrieb:
> I am trying to use Fast SSS 2 from Stbenge macro but can't manage to get an
> ordinary finish with it. any specularity seems to cover up the effect. Here is
> what I tried By directly modifying example files from around here (I modified
> Object 2):

I don't know much about Samuel's macros (heck, the guy should be around 
here somewhere - don't know why he's not responding himself; keep your 
eyes peeled for a guy named "Samuel [T.] Benge"), but I think it's a 
2-pass approach; maybe you accidently applied the specularity in the 
first pass but should only use it in the second one.


Post a reply to this message

From: Mr
Subject: Re: stbenge Fastprox fast SSS
Date: 23 Aug 2009 04:20:01
Message: <web.4a90fb7d6629da5e64b6db110@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Mr schrieb:
> > I am trying to use Fast SSS 2 from Stbenge macro but can't manage to get an
> > ordinary finish with it. any specularity seems to cover up the effect. Here is
> > what I tried By directly modifying example files from around here (I modified
> > Object 2):
>
> I don't know much about Samuel's macros (heck, the guy should be around
> here somewhere - don't know why he's not responding himself; keep your
> eyes peeled for a guy named "Samuel [T.] Benge"), but I think it's a
> 2-pass approach; maybe you accidently applied the specularity in the
> first pass but should only use it in the second one.

I did try the SSLT, which is nice but not yet optimized for the speed I need

When I applied the finish instead of the finish of the object of the exemple
scene I expected it to work but I guess I should not touch it there and use
some kind of earlier declaration of the finish? Where to call for it anyway? Do
I need to put some condition syntax for that radiosity pass stuff and how it
should treat the finish?


Post a reply to this message

From: stbenge
Subject: Re: stbenge Fastprox fast SSS
Date: 25 Aug 2009 07:23:47
Message: <4a93c9c3@news.povray.org>
Mr wrote:
> I am trying to use Fast SSS 2 from Stbenge macro but can't manage to get an
> ordinary finish with it. any specularity seems to cover up the effect. Here is
> what I tried By directly modifying example files from around here (I modified
> Object 2):
/*clip my own bad code*/
> Any idea on how to integrate that macro in a custom material?

Yes,

I'm very sorry about the bad examples I produced. Somehow the wrong 
scene files ended up with my code archive. What you and everybody else 
ended up with was my scene-testing file for everything!

Here's a clearer example of how to interface one of my SSS macros into a 
usable texture:

// begin code

camera{
  location<0,10,-10>
  look_at 0
}

#include"fast_prox.inc"

#declare lpos=<1,.5,0>;

light_source{lpos*100000,rgb 1}

#declare obj=
union{
  cylinder{-x*3,x*3,2}
  cylinder{-y*3,y*3,2}
  cylinder{-z*3,z*3,2}
  sphere{0,2.5}
  rotate y*45 // transforms are applied before SSS
}

#declare thisSSS=
pigment{pigment_pattern{fastSSS2(obj,lpos*100000,min_extent(obj)-0.5,max_extent(obj)+0.5,<1,1,1>*8,2,20)}}

object{obj
  texture{
   pigment_pattern{thisSSS}
   texture_map{
    [0
     pigment{rgb 0}
     finish{specular 0}
    ]
    [1
     pigment{rgb<1,1,.125>}
     finish{specular 1}
    ]
   }
  }
}

// end code

Any time you wish to create a new texture_map, pigment_map or colour_map 
from an existing pattern, encapsulate it withing a pigment_pattern 
statement like you see above. By doing so, you will ensure that any 
following map statements you give the pattern will take effect.

Sometimes you might not know if a macro will produce a pigment_pattern, 
so it's always a safe bet to encapsulate it properly if what you are 
trying does not take effect.

I hope this helps a bit. If not, I'll keep checking this thread!

Sam


Post a reply to this message

From: stbenge
Subject: Re: stbenge Fastprox fast SSS
Date: 25 Aug 2009 08:17:50
Message: <4a93d66e@news.povray.org>
stbenge wrote:
> Mr wrote:
>> I am trying to use Fast SSS 2 from Stbenge macro but can't manage to 
>> get an
>> ordinary finish with it. any specularity seems to cover up the effect. 

Here's a simpler version:

object{obj
  texture{
   pigment{
 
fastSSS2(obj,lpos*100000,min_extent(obj)-0.5,max_extent(obj)+0.5,<1,1,1>*8,3,20)
    colour_map{[0 rgb 0][1 rgb<1,.25,.5>]}
   }
   finish{phong 1 phong_size 200 reflection{.002,1 falloff 2} ambient .5 
diffuse 0}
  }
}

I hope that indentation turns out all right.

Sam


Post a reply to this message

From: Mr
Subject: Re: stbenge Fastprox fast SSS
Date: 25 Aug 2009 18:25:00
Message: <web.4a9462586629da5ee0503b6a0@news.povray.org>
stbenge <not### [at] hotmailcom> wrote:
> stbenge wrote:
> > Mr wrote:
> >> I am trying to use Fast SSS 2 from Stbenge macro but can't manage to
> >> get an
> >> ordinary finish with it. any specularity seems to cover up the effect.
>
> Here's a simpler version:
>
> object{obj
>   texture{
>    pigment{
>
> fastSSS2(obj,lpos*100000,min_extent(obj)-0.5,max_extent(obj)+0.5,<1,1,1>*8,3,20)
>     colour_map{[0 rgb 0][1 rgb<1,.25,.5>]}
>    }
>    finish{phong 1 phong_size 200 reflection{.002,1 falloff 2} ambient .5
> diffuse 0}
>   }
> }
>
> I hope that indentation turns out all right.
>
> Sam


Thanks a lot for your support. Before I dive straight into editing my shader in
PovWin, I also would like to ask if you think there may be a solution to this:

The exporter I'm using (Bend2pov) doesn't allow me to call
for the object that is declared automatically. I can append texture blocks to it
or anything inside the object block or even in the globals I can declare stuff.
But the real object, a blender model, (So there's no point in completely
writing it down as a mesh2 myself...) That object, said I, to which I want to
apply the macro can't be called inside any of these blocks as if it was written
after the call is parsed. I tried declaring a dummy object with the same name,
but it doesn't get overridden by anything automatically generated maybe the
#local directive can be used for something like that? Or Is Even this call to
obj really necessary? Any clue can help as I'm a PovNoob


Post a reply to this message

From: Mr
Subject: Re: stbenge Fastprox fast SSS
Date: 25 Aug 2009 19:00:00
Message: <web.4a946bfd6629da5ee0503b6a0@news.povray.org>
"Mr" <nomail@nomail> wrote:

> Thanks a lot for your support. Before I dive straight into editing my shader in
> PovWin, I also would like to ask if you think there may be a solution to this:

Don't bother actually, I just found the way to do exactly what I wanted with the
exporter, This app combination could become a killer.
(Big joy now!)

For those who would want to try it, I just had to declare the lpos and light in
the Init text file. Then anything referring to the object I put in the PovMat
text file which is appended late enough in the pov files to be able to call for
it after it has automatically been declared.

Is it true That if I directly include the macro inside my scene instead of
including and calling for it wherever it is, it will render faster...?


Post a reply to this message

From: stbenge
Subject: Re: stbenge Fastprox fast SSS
Date: 25 Aug 2009 21:21:24
Message: <4a948e14@news.povray.org>
Mr wrote:
> "Mr" <nomail@nomail> wrote:
> 
>> Thanks a lot for your support. Before I dive straight into editing my shader in
>> PovWin, I also would like to ask if you think there may be a solution to this:
> 
> Don't bother actually, I just found the way to do exactly what I wanted with the
> exporter, This app combination could become a killer.
> (Big joy now!)

I'm glad you got it working!

> Is it true That if I directly include the macro inside my scene instead of
> including and calling for it wherever it is, it will render faster...?

What version are you using? It used to be true. This problem seems to 
have been fixed in the newer 3.7 beta releases.

Sam


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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