Entradas

Mostrando las entradas etiquetadas como sierpinski

Blender Cycles OSL: Sierpinski Squares

Imagen
Hi everybody. Today I'm going to show you a Sierpinski Squares material using OSL and blender. The code for the sierpinski squares pattern is as follows: /* *   Migrated from "http://glsl.heroku.com/e#1891.0" *   By: elbrujodelatribu */ float genCheck(vector p, float res) {     return (mod(res * p[0], 1.0) < 0.5 ^ mod(res * p[1], 1.0) < 0.5) ?         0.0 : 1.0; } shader node_sierpinski_squares(     float Scale = 1.0,     float Zoom = 1.0,     vector Vector = P,     float MaxIterations = 10.0,     output float Fac = 1.0,     output color ColorOut = 0.8)    {     vector p = Vector*Scale/(2.0*Zoom);     float diExp = 1.0;     float result = genCheck(p,1.0);     for(float i = 0.7; i <= MaxIterations; i++)     {   ...