All pastes #254130 Raw Edit

Unnamed

public c v1 · immutable
#254130 ·published 2006-11-21 15:00 UTC
rendered paste body
//from blender/render/intern/source/texture.cstatic int texnoise(Tex *tex, TexResult *texres){	float div=3.0, val;	int ran, loop;		BLI_srand(tex->seed); /* random seed. same each time -> each pixel gets same value :( */	val= BLI_frand() * 3;  /* gives random number between 0 and 3 */		/*relevant for only noisedepth*/	loop= tex->noisedepth;	while(loop--) {		ran= (ran>>2);		val*= (ran & 3);		div*= 3.0;	}		texres->tin= val/div;	BRICONT;	return TEX_INT;}