Material Database

View Source

<?xml version="1.0" encoding="utf-8"?>
<scenedata>
	<material>
		<name>base-ceramic</name>
		<phong>
			<diffuse_albedo>
				<constant>
					<rgb>
						<rgb>
							0.9062 0.9453 0.9141
						</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</diffuse_albedo>
			<exponent>
				<constant>
					300000
				</constant>
			</exponent>
			<bump>
				<shader>
					<shader><![CDATA[def coords ( ) vec2 :
	getTexCoords ( 0 )

def get_tilevec( vec2 pos ) vec2 :
	vec2 ( floor ( doti ( pos ) ) , floor ( dotj ( pos ) ) )

def random_place(vec2 tilevec) vec3 :
	vec3	(
		noise ( tilevec  * 1.414213562373095 ) * 0.01 ,
		noise ( tilevec  * 3.141592653589793 ) * 0.01,
		noise ( tilevec * 2.64575131106 )  * 0.015
		) 

def placement ( vec3 place )  vec2 : 
	mat2x2 ( 	cos( dotk ( place) ) , 0. - sin( dotk ( place ) )  ,
			sin ( dotk ( place) ) , cos ( dotk ( place ) ) )
		* vec2 (	fract( doti (coords ( ) ) ) - 0.5 , 
				fract( dotj (coords ( ) ) ) - 0.5		) 
		+ vec2 ( 0.5 , 0.5 ) 
		+ vec2 ( doti(place), dotj(place) )

def crn ( real a, real b ) real :
	0.5 * ( a + b - sqrt ( (a - b) * (a - b) + 0.0001 ) )

def pyra ( vec2 xy ) real :
	crn	( 
		crn	(
			fract( doti( xy )  ) , 
			1. - fract(doti ( xy ) )
			) ,   	
		crn	(
			fract(dotj ( xy ) ) ,
			1. - fract(dotj ( xy ) )
			) 
		)

def shape( real x ) real :
	sqrt( x* ( 2. - x ) )

def profile () real :
	shape(
		clamp ( (
			
			pyra ( placement (
			random_place(get_tilevec( coords () ) ) 
			) )
				- 0.007 
			) * 20. , 0. , 1.
			 )
		) * 0.002


def eval() real :
	profile () +
	noise ( getTexCoords(0) * 10. ) * 0.00001]]></shader>
				</shader>
			</bump>
			<displacement>
				<shader>
					<shader><![CDATA[def coords ( ) vec2 :
	getTexCoords ( 0 )

def get_tilevec( vec2 pos ) vec2 :
	vec2 ( floor ( doti ( pos ) ) , floor ( dotj ( pos ) ) )

def random_place(vec2 tilevec) vec3 :
	vec3	(
		noise ( tilevec  * 1.414213562373095 ) * 0.01 ,
		noise ( tilevec  * 3.141592653589793 ) * 0.01,
		noise ( tilevec * 2.64575131106 )  * 0.015
		) 

def placement ( vec3 place )  vec2 : 
	mat2x2 ( 	cos( dotk ( place) ) , 0. - sin( dotk ( place ) )  ,
			sin ( dotk ( place) ) , cos ( dotk ( place ) ) )
		* vec2 (	fract( doti (coords ( ) ) ) - 0.5 , 
				fract( dotj (coords ( ) ) ) - 0.5		) 
		+ vec2 ( 0.5 , 0.5 ) 
		+ vec2 ( doti(place), dotj(place) )

def crn ( real a, real b ) real :
	0.5 * ( a + b - sqrt ( (a - b) * (a - b) + 0.0001 ) )

def pyra ( vec2 xy ) real :
	crn	( 
		crn	(
			fract( doti( xy )  ) , 
			1. - fract(doti ( xy ) )
			) ,   	
		crn	(
			fract(dotj ( xy ) ) ,
			1. - fract(dotj ( xy ) )
			) 
		)

def shape( real x ) real :
	sqrt( x* ( 2. - x ) )

def profile () real :
	shape(
		clamp ( (
			
			pyra ( placement (
			random_place(get_tilevec( coords () ) ) 
			) )
				- 0.007 
			) * 20. , 0. , 1.
			 )
		) * 0.002

def eval() real :
	0.0 #profile()]]></shader>
				</shader>
			</displacement>
			<layer>0</layer>
			<fresnel_scale>1</fresnel_scale>
			<ior>1.35</ior>
			<nk_data></nk_data>
		</phong>
	</material>

	<material>
		<name>base-joint-clean</name>
		<diffuse>
			<albedo>
				<constant>
					<rgb>
						<rgb>
							0.668 0.668 0.668
						</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</albedo>
			<bump>
				<shader>
					<shader><![CDATA[def joint_height() real :
	noise( getTexCoords(0) *2.25 )* 0.0006 + 0.0006

def eval() real :
	joint_height() ]]></shader>
				</shader>
			</bump>
			<displacement>
				<shader>
					<shader><![CDATA[def joint_height() real :
	noise( getTexCoords(0) *2.25 )* 0.0006 + 0.0006

def eval() real :
	0.0 #joint_height()]]></shader>
				</shader>
			</displacement>
			<random_triangle_colours>false</random_triangle_colours>
			<layer>0</layer>
		</diffuse>
	</material>

	<material>
		<name>base-joint-dirty</name>
		<diffuse>
			<albedo>
				<constant>
					<rgb>
						<rgb>
							0.4766 0.4648 0.4531
						</rgb>
						<gamma>2.2</gamma>
					</rgb>
				</constant>
			</albedo>
			<bump>
				<shader>
					<shader><![CDATA[def joint_height() real :
	noise( getTexCoords(0) *2.25 )* 0.0006 + 0.0006

def eval() real :
	joint_height() ]]></shader>
				</shader>
			</bump>
			<displacement>
				<shader>
					<shader><![CDATA[def joint_height() real :
	noise( getTexCoords(0) *2.25 )* 0.0006 + 0.0006

def eval() real :
	0.0 #joint_height()]]></shader>
				</shader>
			</displacement>
			<random_triangle_colours>false</random_triangle_colours>
			<layer>0</layer>
		</diffuse>
	</material>

	<material>
		<name>base-joint</name>
		<blend>
			<a_name>base-joint-clean</a_name>
			<b_name>base-joint-dirty</b_name>
			<blend>
				<shader>
					<shader><![CDATA[def eval() real :
	noise(getTexCoords(0)*0.5)]]></shader>
				</shader>
			</blend>
			<step_blend>false</step_blend>
		</blend>
	</material>

	<material>
		<name>ceramic-procedural-bump</name>
		<blend>
			<a_name>base-ceramic</a_name>
			<b_name>base-joint</b_name>
			<blend>
				<shader>
					<shader><![CDATA[def coords ( ) vec2 :
	getTexCoords ( 0 )

def get_tilevec( vec2 pos ) vec2 :
	vec2 ( floor ( doti ( pos ) ) , floor ( dotj ( pos ) ) )

def random_place(vec2 tilevec) vec3 :
	vec3	(
		noise ( tilevec  * 1.414213562373095 ) * 0.01 ,
		noise ( tilevec  * 3.141592653589793 ) * 0.01,
		noise ( tilevec * 2.64575131106 )  * 0.015
		) 

def placement ( vec3 place )  vec2 : 
	mat2x2 ( 	cos( dotk ( place) ) , 0. - sin( dotk ( place ) )  ,
			sin ( dotk ( place) ) , cos ( dotk ( place ) ) )
		* vec2 (	fract( doti (coords ( ) ) ) - 0.5 , 
				fract( dotj (coords ( ) ) ) - 0.5		) 
		+ vec2 ( 0.5 , 0.5 ) 
		+ vec2 ( doti(place), dotj(place) )


def crn ( real a, real b ) real :
	0.5 * ( a + b - sqrt ( (a - b) * (a - b) + 0.0001 ) )

def pyra ( vec2 xy ) real :
	crn	( 
		crn	(
			fract( doti( xy )  ) , 
			1. - fract(doti ( xy ) )
			) ,   	
		crn	(
			fract(dotj ( xy ) ) ,
			1. - fract(dotj ( xy ) )
			) 
		)

def shape( real x ) real :
	sqrt( x* ( 2. - x ) )

def profile () real :
	shape(
		clamp ( (
			
			pyra ( placement (
			random_place(get_tilevec( coords () ) ) 
			) )
				- 0.007 
			) * 20. , 0. , 1.
			 )
		) * 0.002

def joint_height() real :
	noise( getTexCoords(0) *9. )* 0.0006 + 0.0006

def eval() real :
	if( gt( joint_height() , profile() ) , 1.0 , 0.0 )
]]></shader>
				</shader>
			</blend>
			<step_blend>true</step_blend>
		</blend>
	</material>

</scenedata>

-->