templargfx opened this issue on Apr 27, 2010 · 103 posts
bagginsbill posted Wed, 28 April 2010 at 11:25 PM
Quote - Gotcha. And you have a HDR sky map on the EnvSphere? That puddle material looks mighty tasty. How do you do that?
The sky map I used is LDR.
Here's how I made the puddle shader. Using matmatic, I made a pavement shader, a water shader, and I mixed them. LOL It's just a test - not finished.
antigamma = PM(1, "Gamma")
gamma = 1 / antigamma def View(x):
return EmptySurface(Alternate_Diffuse = x)
def AGC(x):
return x ** antigamma
def GC(x):
return x ** gamma
def PuddleMask(s=8):
m = Clamp(3 * FractalSum(s, s, s, 2, 0, .45, .999))
return m
def PavementSurface():
clr = PMC(.3, "Pavement Color")
clr1 = AGC(clr)
clr2 = AGC(clr + .1)
dc = Spots(clr1, clr2, .1, 0, .25, 0, 2)
diffuse = Clay(dc, .8, .5)
output = GC(diffuse)
s = EmptySurface()
s.Alternate_Diffuse = output
s.Bump = .1 * FractalSum(.2, .2, .2, 8, 0, .5, .7)
return s, diffuse
def WaterSurface(under = BLACK, ripple = 0):
s = EmptySurface()
fresnel = TrueFresnel(1.33)
reflect = AGC(Reflect())
output = Blend(under, reflect, fresnel)
output = GC(output)
if ripple:
if isNode(ripple):
s.Bump = ripple
else:
s.Bump = ripple * FractalSum(1, 1, 1, 2, 0, .5, .93)
s.Alternate_Diffuse = output
return s
pavement, pdif = PavementSurface()
water = WaterSurface(pdif, .1)
refract = AGC(Refract(0, 1))
under = EmptySurface(Alternate_Diffuse = GC(refract))
refpuddles = Mix(under, WaterSurface(refract, .1), PuddleMask())
outputs += [
"Test", Mix(pavement, water, PuddleMask())
]
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)