<?xml version="1.0" encoding="1252"?>
<scenedata>

<material>
	<name>phong2SG</name>
	<phong>
		<shared_shader_info>
				<param>
					<real>
						<name>ShapeShift</name>
						<description>ShapeShift</description>
						<min>0</min>
						<max>1</max>
						<value>0</value>
					</real>
				</param>
				<param>
					<real>
						<name>AlveolesShapePower</name>
						<description>AlveolesShapePower</description>
						<min>0.5</min>
						<max>1</max>
						<value>1.35</value>
					</real>
				</param>
				<param>
					<real>
						<name>AlveolesShapeShift</name>
						<description>AlveolesShapeShift</description>
						<min>0</min>
						<max>1</max>
						<value>0</value>
					</real>
				</param>
				<param>
					<real>
						<name>ShapePower</name>
						<description>ShapePower</description>
						<min>0</min>
						<max>10</max>
						<value>1.1</value>
					</real>
				</param>
				<param>
					<int>
						<name>SwapDirections</name>
						<description>SwapDirections</description>
						<min>0</min>
						<max>1</max>
						<value>1</value>
					</int>
				</param>
			<shader><![CDATA[]]></shader>
		</shared_shader_info>
		<exponent>
			<!-- mti_GEN_indigoText indigoText4 -->
			<shader>
				<wavelength_dependent>false</wavelength_dependent>
				<shader><![CDATA[
def eval(vec3 pos) real :
	fbm01(tex(), 8) * 190.0 + 8.0
				]]></shader>
			</shader>
</exponent>
		<diffuse_albedo>
			<!-- mti_GEN_indigoText indigoText1 -->
			<shader>
				<param>
					<colour3>
						<name>C1</name>
						<description>C1</description>
						<value>0.5725490451 0.5058823824 0.2196078449</value>
					</colour3>
				</param>
				<param>
					<colour3>
						<name>C2</name>
						<description>C2</description>
						<value>0.8470588326 0.3215686381 0.2588235438</value>
					</colour3>
				</param>
				<param>
					<real>
						<name>Variance</name>
						<description>Variance</description>
						<min>0</min>
						<max>1</max>
						<value>0.2</value>
					</real>
				</param>
				<wavelength_dependent>false</wavelength_dependent>
				<shader><![CDATA[
def op_add(vec3 v3, real r) vec3:
vec3(v3.x + r, v3.y + r, v3.z + r)

def eval(vec3 pos) vec3:
let

swap = paramSwapDirections()
txi = if(swap==1, texj(), texi())
txj = if(swap==1, texi(), texj())

maturationPlacement = vec2(txi + toFloat(objectId()) , txj * 4.0) * 0.5
variancePlacement = maturationPlacement * 7.0

map = (	fbm01(maturationPlacement, 8)
	+	fbm01(variancePlacement, 8)
	) * 0.5
smooth = smootherstep(0.15, 0.9, map)
cos = cos(txi * 6.29) * 0.5 + 0.5
map2 = (smooth + cos) * 0.5

in

lerp(	vec3(paramC2().x * map * paramVariance() + 1.0 - paramVariance(), paramC2().y, paramC2().z),
		vec3(paramC1().x * map * paramVariance() + 1.0 - paramVariance(), paramC1().y, paramC1().z),

pow(smooth, 4.0) + pow(cos, 4.0) * 1.25
#pow(cos, 1.5)
) * map * 0.75 + 0.025
				]]></shader>
			</shader>
</diffuse_albedo>
		<ior>1.230000019</ior>
		<bump>
			<!-- mti_GEN_indigoText indigoText3 -->
			<shader>
				<wavelength_dependent>false</wavelength_dependent>
				<shader><![CDATA[
def eval() real :
	fbm(vec2(texi() * 4.0, texj()) * 60.0, 4) * 0.000003
				]]></shader>
			</shader>
</bump>
		<displacement>
			<!-- mti_GEN_indigoText indigoText2 -->
			<shader>
				<wavelength_dependent>false</wavelength_dependent>
				<shader><![CDATA[
def eval() real : 
let

swap = paramSwapDirections()
txi = if(swap==1, texj(), texi())
txj = if(swap==1, texi(), texj())
pi = pi()
halfCyclej = (pow(txi, paramShapePower()) + paramShapeShift()) * pi
cyclej = halfCyclej * 2.0
cosj = cos(cyclej)
sinj = sin(halfCyclej)



alveolesShape = 1.0 - (sin(txj * 10.0 * pi)) * 0.5 + 0.5
alveolesScale = (cosj * 0.5 + 0.5) * sinj



#alveoles = alveolesShape * alveolesScale * sinj * 0.2
alveoles = alveolesShape * alveolesScale * sinj# - 1.0



in



# alveolesScale
# alveolesShape * sinj
((alveoles * 2.0 - 1.0) * (1.0 - sinj) * 2.0)# - 1.0
# sinj
# cosj
* 0.001
				]]></shader>
			</shader>
</displacement>
	</phong>
</material>
</scenedata>
