Home > Materials > Ceramic > Terracotta tile floor "Vintage Handbaked" > View Source
<?xml version="1.0" encoding="utf-8" ?>
<scenedata>
<material>
<name>base-terracota</name>
<phong>
<texture>
<path>PACKED_0_PACKED_0_terracotta-tint.png</path>
<a>0</a>
<b>1</b>
<c>0</c>
<uv_set>default</uv_set>
<exponent>2.2</exponent>
<tex_coord_generation>
<uv />
</tex_coord_generation>
</texture>
<diffuse_albedo>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
( getTexCoords ( 0 )
+ vec2 (
noise ( getTexCoords ( 0 ) * 0.5 ) * 0.07 ,
noise ( getTexCoords ( 0 ) * 0.53 + vec2 ( 15.7 , 23.6 )) * 0.07
)
) * scaling()
def maille_xy () vec2 :
vec2( floor(doti(coords())) ,
floor ( dotj ( coords() * 0.577350269189 )) * 1.732050807568 )
def closest( vec2 fracp ) vec2:
if ( lt ( doti ( fracp ) , 0.5 ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( 0.5 , 0.866025403784 )), 0.5 ) ,
vec2( 0.0 , 0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp , vec2( 0.5 , -0.866025403784 )), -1.0 ) ,
vec2( 0.0 , 1.732050807568 ) , vec2( 0.5 , 0.866025403784 ) ) ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( -0.5 , 0.866025403784 )), 0.0 ) ,
vec2( 1.0,0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp, vec2( -0.5 , -0.866025403784 )), -1.5 ) ,
vec2( 1.0 , 1.732050807568 ), vec2( 0.5 , 0.866025403784 ) ) )
)
def tile_xy() vec2:
maille_xy() + closest ( coords() - maille_xy() )
def tint( vec2 tile ) vec2 :
vec2 (
#tint
fract (
0.05 * noise ( tile * 7.645169841)
+ 0.30
),
#burn
sqrt(clamp (
fbm ( coords() * 0.2 + tile * 13.456698 , 7 )
* 0.1 + 0.1
, 0.05 , 0.99
))
)
def final ( vec2 tile ) vec3:
( sample2DTextureVec3( 0 , tint( tile ) ) * 3.0 ) + vec3(0.02)
def eval(vec3 pos) vec3 :
final ( tile_xy() )
]]>
</shader>
</shader>
</diffuse_albedo>
<exponent>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
( getTexCoords ( 0 ) ) * scaling()
def eval(vec3 pos) real :
exp ( fbm ( coords() , 5 ) ) * 100. ]]>
</shader>
</shader>
</exponent>
<bump>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
( getTexCoords ( 0 )
+ vec2 (
noise ( getTexCoords ( 0 ) * 0.5 ) * 0.07 ,
noise ( getTexCoords ( 0 ) * 0.53 + vec2 ( 15.7 , 23.6 )) * 0.07
)
) * scaling()
def maille_xy () vec2 :
vec2( floor(doti(coords())) ,
floor ( dotj ( coords() * 0.577350269189 )) * 1.732050807568 )
def closest( vec2 fracp ) vec2:
if ( lt ( doti ( fracp ) , 0.5 ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( 0.5 , 0.866025403784 )), 0.5 ) ,
vec2( 0.0 , 0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp , vec2( 0.5 , -0.866025403784 )), -1.0 ) ,
vec2( 0.0 , 1.732050807568 ) , vec2( 0.5 , 0.866025403784 ) ) ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( -0.5 , 0.866025403784 )), 0.0 ) ,
vec2( 1.0,0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp, vec2( -0.5 , -0.866025403784 )), -1.5 ) ,
vec2( 1.0 , 1.732050807568 ), vec2( 0.5 , 0.866025403784 ) ) )
)
def tile_xy() vec2:
maille_xy() + closest ( coords() - maille_xy() )
def local_xy() vec2:
coords() - tile_xy()
def final ( vec2 tile, vec2 loc) real :
fbm ( loc * 0.63 + tile * 7.6584 , 4 ) * 0.0015
+ min ( 0. , 0.6 + fbm ( (tile + loc) * 15. , 10 ) ) * 0.003
def eval() real :
final ( tile_xy(), local_xy() ) / scaling()]]>
</shader>
</shader>
</bump>
<displacement>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
( getTexCoords ( 0 )
+ vec2 (
noise ( getTexCoords ( 0 ) * 0.5 ) * 0.07 ,
noise ( getTexCoords ( 0 ) * 0.53 + vec2 ( 15.7 , 23.6 )) * 0.07
)
) * scaling()
def maille_xy () vec2 :
vec2( floor(doti(coords())) ,
floor ( dotj ( coords() * 0.577350269189 )) * 1.732050807568 )
def closest( vec2 fracp ) vec2:
if ( lt ( doti ( fracp ) , 0.5 ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( 0.5 , 0.866025403784 )), 0.5 ) ,
vec2( 0.0 , 0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp , vec2( 0.5 , -0.866025403784 )), -1.0 ) ,
vec2( 0.0 , 1.732050807568 ) , vec2( 0.5 , 0.866025403784 ) ) ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( -0.5 , 0.866025403784 )), 0.0 ) ,
vec2( 1.0,0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp, vec2( -0.5 , -0.866025403784 )), -1.5 ) ,
vec2( 1.0 , 1.732050807568 ), vec2( 0.5 , 0.866025403784 ) ) )
)
def tile_xy() vec2:
maille_xy() + closest ( coords() - maille_xy() )
def local_xy() vec2:
coords() - tile_xy()
def random_place(vec2 tile) vec3 :
vec3 (
noise ( tile*1.41421356237 ) * 0.005 ,
noise ( tile*3.14159265358 ) * 0.005,
noise ( tile*2.64575131106 ) * 0.011
)
def placement ( vec2 loc , vec3 place ) vec2 :
mat2x2 ( cos( dotk ( place) ) , 0. - sin( dotk ( place ) ) ,
sin ( dotk ( place) ) , cos ( dotk ( place ) ) )
* loc + vec2 ( doti(place), dotj(place) )
def crn ( real a, real b ) real :
0.5 * ( a + b - sqrt ( (a - b) * (a - b) + 0.001 ) )
def pyra( vec2 xy ) real:
0.5 + crn(
min( dot ( xy , vec2(1.0,0.0) ) , dot ( xy , vec2( -1.0,0.0) ) ) ,
crn (
min( dot ( xy , vec2(0.5, 0.86602540) ) ,
dot ( xy , vec2( -0.5, -0.86602540) ) ),
min( dot ( xy , vec2(0.5, -0.86602540) ) ,
dot ( xy , vec2( -0.5, 0.86602540) ) )
)
)
def shape( real x ) real :
sqrt( x* ( 2. - x ) )
def edge_shakiness( vec2 tile, vec2 loc ) real :
( noise ( loc * 2.5 + tile * 9.4567453) * 0.015 )
def profile ( vec2 tile, vec2 loc , real p ) real:
(shape(
clamp ( ( p - 0.005 + edge_shakiness(tile, loc) ) *60.
, 0. , 1. )
)
+ 10.0 * min( 0. ,
p - ( 0.07 * fbm ( loc * 3.14159 + tile * 15.69584 , 4 ) ) )
)
* 0.01
+ dot (
loc,
vec2 ( noise ( tile * 8.5864 ) , noise ( tile * 12.58649 ) )
) * 0.01
def final ( vec2 tile, vec2 loc ) real :
profile ( tile, loc, pyra(placement( loc , random_place(tile) ) ) )
def eval() real :
final ( tile_xy(), local_xy() ) / scaling()]]>
</shader>
</shader>
</displacement>
<layer>0</layer>
<fresnel_scale>1</fresnel_scale>
<ior>1.45</ior>
<nk_data />
</phong>
</material>
<material>
<name>base-joint-clean</name>
<phong>
<diffuse_albedo>
<constant>
<rgb>
<rgb>0.3125 0.2656 0.2148</rgb>
<gamma>2.2</gamma>
</rgb>
</constant>
</diffuse_albedo>
<exponent>
<constant>200</constant>
</exponent>
<bump>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
getTexCoords (0) * scaling()
def joint_height() real :
0.005
def eval() real :
( joint_height()
- abs( fbm ( coords() * 10. , 10 ) * 0.016 ))
/ scaling()]]>
</shader>
</shader>
</bump>
<displacement>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def joint_height() real :
0.005
def eval() real :
joint_height() / scaling()]]>
</shader>
</shader>
</displacement>
<layer>0</layer>
<fresnel_scale>1</fresnel_scale>
<ior>1.2</ior>
<nk_data />
</phong>
</material>
<material>
<name>terracotta-tiles</name>
<blend>
<a_name>base-terracota</a_name>
<b_name>base-joint-clean</b_name>
<blend>
<shader>
<shader>
<![CDATA[def scaling() real :
1.
def coords ( ) vec2 :
( getTexCoords ( 0 )
+ vec2 (
noise ( getTexCoords ( 0 ) * 0.5 ) * 0.07 ,
noise ( getTexCoords ( 0 ) * 0.53 + vec2 ( 15.7 , 23.6 )) * 0.07
)
) * scaling()
def maille_xy () vec2 :
vec2( floor(doti(coords())) ,
floor ( dotj ( coords() * 0.577350269189 )) * 1.732050807568 )
def closest( vec2 fracp ) vec2:
if ( lt ( doti ( fracp ) , 0.5 ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( 0.5 , 0.866025403784 )), 0.5 ) ,
vec2( 0.0 , 0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp , vec2( 0.5 , -0.866025403784 )), -1.0 ) ,
vec2( 0.0 , 1.732050807568 ) , vec2( 0.5 , 0.866025403784 ) ) ),
if ( lt ( dotj ( fracp ) , 0.866025403784 ),
if( lt( dot ( fracp , vec2( -0.5 , 0.866025403784 )), 0.0 ) ,
vec2( 1.0,0.0 ) , vec2( 0.5 , 0.866025403784 ) ),
if( lt( dot ( fracp, vec2( -0.5 , -0.866025403784 )), -1.5 ) ,
vec2( 1.0 , 1.732050807568 ), vec2( 0.5 , 0.866025403784 ) ) )
)
def tile_xy() vec2:
maille_xy() + closest ( coords() - maille_xy() )
def local_xy() vec2:
coords() - tile_xy()
def random_place(vec2 tile) vec3 :
vec3 (
noise ( tile*1.41421356237 ) * 0.005 ,
noise ( tile*3.14159265358 ) * 0.005,
noise ( tile*2.64575131106 ) * 0.011
)
def placement ( vec2 loc , vec3 place ) vec2 :
mat2x2 ( cos( dotk ( place) ) , 0. - sin( dotk ( place ) ) ,
sin ( dotk ( place) ) , cos ( dotk ( place ) ) )
* loc + vec2 ( doti(place), dotj(place) )
def crn ( real a, real b ) real :
0.5 * ( a + b - sqrt ( (a - b) * (a - b) + 0.001 ) )
def pyra( vec2 xy ) real:
0.5 + crn(
min( dot ( xy , vec2(1.0,0.0) ) , dot ( xy , vec2( -1.0,0.0) ) ) ,
crn (
min( dot ( xy , vec2(0.5, 0.86602540) ) ,
dot ( xy , vec2( -0.5, -0.86602540) ) ),
min( dot ( xy , vec2(0.5, -0.86602540) ) ,
dot ( xy , vec2( -0.5, 0.86602540) ) )
)
)
def shape( real x ) real :
sqrt( x* ( 2. - x ) )
def edge_shakiness( vec2 tile, vec2 loc ) real :
( noise ( loc * 2.5 + tile * 9.4567453) * 0.015 )
def profile ( vec2 tile, vec2 loc , real p ) real:
(shape(
clamp ( ( p - 0.005 + edge_shakiness(tile, loc) ) * 60.
, 0. , 1. )
)
+ 10.0 * min( 0. ,
p - ( 0.07 * fbm ( loc * 3.14159 + tile * 15.69584 , 4 ) ) )
)
* 0.01
+ dot (
loc,
vec2 ( noise ( tile * 8.5864 ) , noise ( tile * 12.58649 ) )
) * 0.01
def joint_height() real :
0.005
def final( vec2 tile, vec2 loc) real :
if( gt( joint_height() ,
profile ( tile , loc , pyra(placement( loc , random_place(tile) ) ) ) ) ,
1.0 ,
0.0 )
def eval () real:
final( tile_xy() , local_xy() )]]>
</shader>
</shader>
</blend>
<step_blend>true</step_blend>
</blend>
</material>
</scenedata>