Blender Cycles OSL: Color Turbulence
Hi every body. Today I'm going to show you a color turbulence material: This is the OSL code: /* * Migrated from "http://glsl.heroku.com/e#8664.0" * By: elbrujodelatribu */ shader node_color_turbulence( vector Vector = P, float Scale = 0.2, float Time = 1.0, int MaxIterations = 64, output color Color = 0.8) { vector p = Vector * Scale;//surfacePosition; for(int i=1; i < MaxIterations; i++) { vector newp = p; newp[0]+=0.6/float(i)*sin(float(i)*p[1]+Time/20.0+0.3*float(i))+20.0; newp[1]+=0.6/float(i)*sin(float(i)*p[0]+Time/20.0+0.3*float(i+10))-5.0; p=newp; } Color = color(sin(Time+p[1]+p[0]-M_PI*color(0,2,4)/(4.0+sin(Time)))*0.3+0.5); } And here there is the node setup. I have used a HSV Color node to increase the color saturation and provide a result more vivid: And this another example scene ( hires version here ). I hope you like it. Bye