Material Database

View Source

<?xml version="1.0" encoding="utf-8"?>
<scenedata>
	<material>
		<name>Passionated</name>
		<phong>
		<shared_shader_info>
				<param>
					<real>
						<name>Density</name>
						<description>density of mix noise</description>
						<min>100</min>
						<max>5000</max>
						<value>100</value>
					</real>
				</param>
				<param>
					<real>
						<name>Jagging</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>0.5</value>
					</real>
				</param>
				<param>
					<real>
						<name>LengthNoise</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>0.055</value>
					</real>
				</param>
				<param>
					<real>
						<name>HairWidth</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>0</value>
					</real>
				</param>
				<param>
					<real>
						<name>Variation</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>0.315</value>
					</real>
				</param>
				<param>
					<real>
						<name>Balance</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>0.795</value>
					</real>
				</param>
				<param>
					<real>
						<name>HairLength</name>
						<description></description>
						<min>0</min>
						<max>1</max>
						<value>1</value>
					</real>
				</param>
				<shader><![CDATA[]]></shader>
		</shared_shader_info>
			<diffuse_albedo>
				<shader>
						<param>
							<colour3>
								<name>Col1</name>
								<description>the forward color</description>
								<value>0 0 0</value>
							</colour3>
						</param>
						<param>
							<colour3>
								<name>Col2</name>
								<description>the grazing color</description>
								<value>0.23099812865257263 0.02422294206917286 0.21576440334320068</value>
							</colour3>
						</param>
						<shader><![CDATA[

def eval(vec3 pos) vec3 : 

let 

col1 = paramCol1()
#	the forward color
# vec3(0.722, 0.439, 0.831)
# vec3(0.616, 0.145, 0.435)

col2 = paramCol2()
#	the grazing color
# vec3(0.329, 0.09, 0.114)
# vec3(0.247, 0.051, 0.078)

variation = paramVariation()
#	amount of noise in mix
#	0.0 -> 1.0
# 0.25

density = paramDensity()
#	density of mix noise
# 2000.0

balance = paramBalance()
#	velvet <-> satin balance
#0.1

#	colour mix
#mixNoise = abs(fbm(tex() * density, 4) * variation)
mixNoise = abs(fbm(vec2(texi(), texj() * 3.0) * density, 4) * variation)

in

lerp(
	col1,
	col2,
	pow(1.0 - maxCosTheta(), ((balance + mixNoise - 0.5) * 2.0))
)

]]></shader>
				</shader>
			</diffuse_albedo>
			<exponent>
				<shader>
						<param>
							<real>
								<name>Exponent1</name>
								<description></description>
								<min>0</min>
								<max>10000</max>
								<value>200</value>
							</real>
						</param>
						<param>
							<real>
								<name>Exponent2</name>
								<description></description>
								<min>0</min>
								<max>10000</max>
								<value>25</value>
							</real>
						</param>
						<shader><![CDATA[
def eval(vec3 pos) real : 

let 

jagging = paramJagging()
texv = fract((texj() * 3.0) * paramDensity()) 
#texu = fract((texi()) * paramDensity())
texu = if( fract((texj())*paramDensity()*0.5)>jagging) 
fract((texi() + recip(paramDensity() * 2.0))*paramDensity()) else
fract((texi()) * paramDensity())
y = 1.0-texu
z = 1.0-texv
a = texu * texv
b = y * texv
c = texu * z
d = y * z
#stones = pow(a*b*c*d*16.0, 0.250) 
stones = a*b*c*d*16.0

length =
# 'hairs' length
 paramHairLength()
 
density = paramDensity()

lengthNoise = paramLengthNoise() * length
lengthNoiseDensityRatio = 0.5 + fbm(tex() * 0.01, 3) / 2.0
#lengthNoiseDensityRatio = 0.5 + fbm(vec2(texi(), texj() * 13.0) * 0.01, 3) / 2.0
pi = pi()
sinU = sin(texi() * pi * density)
sinV = sin(texj() * 3.0 * pi * density)
#term = 0.5 + min(sinU, sinV) * 0.5
#term = abs(min(sinU, sinV))
#term = stones
term = clamp(stones + paramHairWidth(), 0.0, 1.0)
t2 = term*term
#*	(1.0 + fbm(tex() * density * lengthNoiseDensityRatio, 2) * lengthNoise)
*	(1.0 + fbm(vec2(texi(), texj() * 3.0) * recip(paramJagging()) * density * lengthNoiseDensityRatio, 3) * lengthNoise)
/	(pi * density / length) 

in
	if(t2>0.00000001) paramExponent2() else paramExponent1()
#2500.0
]]></shader>
				</shader>
			</exponent>
			<bump>
				<shader>
						<shader><![CDATA[

def eval() real : 

let 

jagging = paramJagging()
texv = fract((texj() * 3.0) * paramDensity()) 
#texu = fract((texi()) * paramDensity())
texu = if( fract((texj())*paramDensity()*0.5)>jagging)
fract((texi() + recip(paramDensity() * 2.0))*paramDensity()) else
fract((texi()) * paramDensity())
y = 1.0-texu
z = 1.0-texv
a = texu * texv
b = y * texv
c = texu * z
d = y * z
#stones = pow(a*b*c*d*16.0, 0.250) 
stones = a*b*c*d*16.0

length =
# 'hairs' length
 paramHairLength()
 
density = paramDensity()

lengthNoise = paramLengthNoise() * length
lengthNoiseDensityRatio = 0.5 + fbm(tex() * 0.01, 3) / 2.0
#lengthNoiseDensityRatio = 0.5 + fbm(vec2(texi(), texj() * 13.0) * 0.01, 3) / 2.0
pi = pi()
sinU = sin(texi() * pi * density)
sinV = sin(texj() * 3.0 * pi * density)
#term = 0.5 + min(sinU, sinV) * 0.5
#term = abs(min(sinU, sinV))
#term = stones
term = clamp(stones + paramHairWidth(), 0.0, 1.0)

in

	term*term
#*	(1.0 + fbm(tex() * density * lengthNoiseDensityRatio, 2) * lengthNoise)
*	(1.0 + fbm(vec2(texi(), texj() * 3.0) * recip(paramJagging()) * density * lengthNoiseDensityRatio, 4) * lengthNoise)
/	(pi * density / length) 
*	10.1
]]></shader>
				</shader>
			</bump>
			<fresnel_scale>
				<shader>
						<param>
							<real>
								<name>Fresnel2</name>
								<description></description>
								<min>0</min>
								<max>1</max>
								<value>0.165</value>
							</real>
						</param>
						<param>
							<real>
								<name>Fresnel1</name>
								<description></description>
								<min>0</min>
								<max>1</max>
								<value>0.44</value>
							</real>
						</param>
						<shader><![CDATA[
def eval(vec3 pos) real : 

let 

jagging = paramJagging()
texv = fract((texj() * 3.0) * paramDensity()) 
#texu = fract((texi()) * paramDensity())
texu = if( fract((texj())*paramDensity()*0.5)>jagging) 
fract((texi() + recip(paramDensity() * 2.0))*paramDensity()) else
fract((texi()) * paramDensity())
y = 1.0-texu
z = 1.0-texv
a = texu * texv
b = y * texv
c = texu * z
d = y * z
#stones = pow(a*b*c*d*16.0, 0.250) 
stones = a*b*c*d*16.0

length =
# 'hairs' length
 paramHairLength()
 
density = paramDensity()

lengthNoise = paramLengthNoise() * length
lengthNoiseDensityRatio = 0.5 + fbm(tex() * 0.01, 3) / 2.0
#lengthNoiseDensityRatio = 0.5 + fbm(vec2(texi(), texj() * 13.0) * 0.01, 3) / 2.0
pi = pi()
sinU = sin(texi() * pi * density)
sinV = sin(texj() * 3.0 * pi * density)
#term = 0.5 + min(sinU, sinV) * 0.5
#term = abs(min(sinU, sinV))
#term = stones
term = clamp(stones + paramHairWidth(), 0.0, 1.0)
t2 = term*term
#*	(1.0 + fbm(tex() * density * lengthNoiseDensityRatio, 2) * lengthNoise)
*	(1.0 + fbm(vec2(texi(), texj() * 3.0) * recip(paramJagging()) * density * lengthNoiseDensityRatio, 3) * lengthNoise)
/	(pi * density / length) 

in
	if(t2>0.00000001) paramFresnel2() else paramFresnel1()
#2500.0
]]></shader>
				</shader>
			</fresnel_scale>
			<layer>0</layer>
			<ior>1.5</ior>
			<nk_data></nk_data>
		</phong>
	</material>
</scenedata>

-->