Using texgen.js on its own

how to use texgen.js on its own, no dependancy

by jetienne

HTML

<script src="http://jeromeetienne.github.io/texgen.js/src/TexGen.js"></script>

JavaScript

// https://github.com/mrdoob/texgen.js

var texture = new TG.Texture( 256, 256 )
		.add( new TG.XOR().tint( 1, 0.5, 0.7 ) )
		.add( new TG.SinX().frequency( 0.004 ).tint( 0.25, 0, 0 ) )
		.sub( new TG.SinY().frequency( 0.004 ).tint( 0.25, 0, 0 ) )
		.add( new TG.SinX().frequency( 0.0065 ).tint( 0.1, 0.5, 0.2 ) )
		.add( new TG.SinY().frequency( 0.0065 ).tint( 0, 0.4, 0.5 ) )
		.add( new TG.Noise().tint( 0.1, 0.1, 0.2 ) )
		.toCanvas();

document.body.appendChild( texture );