View Source
<?xml version="1.0" encoding="utf-8" ?>
<scenedata>
<material>
<name>Woodchip Wallpaper</name>
<diffuse>
<albedo>
<constant>
<rgb>
<rgb>0.8 0.8 0.8</rgb>
<gamma>2.2</gamma>
</rgb>
</constant>
</albedo>
<bump>
<shader>
<param>
<real>
<name>WoodChipScale</name>
<description>Scale of the wood chips in the wallpaper</description>
<min>0.00001</min>
<max>1000000</max>
<value>320</value>
</real>
</param>
<param>
<int>
<name>WoodChipOctaves</name>
<description>Number of octaves used in FBM</description>
<min>1</min>
<max>10</max>
<value>2</value>
</int>
</param>
<param>
<real>
<name>WoodChipBumpScale</name>
<description>Height of the wood chips in the wallpaper</description>
<min>0</min>
<max>1</max>
<value>0.00025</value>
</real>
</param>
<param>
<real>
<name>WallpaperWidth</name>
<description>The width of the wallpaper (disance between seams)</description>
<min>0.0001</min>
<max>1000</max>
<value>0.47</value>
</real>
</param>
<param>
<real>
<name>SeamDepth</name>
<description>Depth of the seams between wallpapers</description>
<min>0</min>
<max>1</max>
<value>0.0005</value>
</real>
</param>
<param>
<real>
<name>SeamWidth</name>
<description>Width of the seam between wallpapers</description>
<min>0</min>
<max>1</max>
<value>0.0005</value>
</real>
</param>
<param>
<real>
<name>GlobalScale</name>
<description>Scales all parameters except for WoodChipOctaves</description>
<min>0.00001</min>
<max>100</max>
<value>6</value>
</real>
</param>
<shader>
<![CDATA[def notClamp(real x, real a, real b) real:
if(x < a || x > b, 0.2 * x, x)
def eval() real:
let
tex_coords = getTexCoords(0)
one_over_scale = 1.0 / paramGlobalScale()
wood_chip_tex_coords = tex_coords * (paramWoodChipScale() * one_over_scale)
scaled_wallpaper_width = paramWallpaperWidth() * paramGlobalScale()
scaled_seam_width = paramSeamWidth() * paramGlobalScale()
scaled_seam_depth = paramSeamDepth() * paramGlobalScale()
scaled_chip_bump = paramWoodChipBumpScale() * paramGlobalScale()
seam_width_half = 0.5 * scaled_seam_width
tex_coords_mod_seams = mod(tex_coords.x + 128.0, scaled_wallpaper_width)
section_offset = real(floorToInt(tex_coords.x / scaled_wallpaper_width)) * 1024.0
in
(
notClamp(fbm01(wood_chip_tex_coords + vec2(section_offset, section_offset), paramWoodChipOctaves()), 0.6, 0.9) +
notClamp(fbm01(wood_chip_tex_coords + vec2(1337.0 + section_offset, 666.0 + section_offset), paramWoodChipOctaves()), 0.6, 0.8) +
notClamp(fbm01(wood_chip_tex_coords + vec2(666.0 + section_offset, 1337.0 + section_offset), paramWoodChipOctaves()), 0.6, 0.8)
) * scaled_chip_bump
#+ noise(wood_chip_tex_coords) * 0.00015 * paramGlobalScale()
- smoothPulse(scaled_wallpaper_width - seam_width_half, scaled_wallpaper_width, 0.0, seam_width_half, tex_coords_mod_seams) * scaled_seam_depth]]>
</shader>
</shader>
</bump>
<random_triangle_colours>false</random_triangle_colours>
<layer>0</layer>
</diffuse>
</material>
</scenedata>