|
|
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
|
|