Entradas

Mostrando las entradas etiquetadas como color

Blender Cycles OSL: Color Turbulence

Imagen
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

Blender Cycles OSL: Color Squares

Imagen
Hi everybody. Today I'm going to show you a color squares pattern material, similar to present papers. The materials looks like this: Here the code is: /* * Migrated from "http://glsl.heroku.com/e#5335.0" * Author: elbrujodelatribu */ // Returns fractional part float fract(float x) { return (x - floor(x)); } // Returns fractional part, by coordenates point fract(point x) { return point(fract(x[0]),fract(x[1]),fract(x[2])); } // Colorize squares point tri(point p, float r) { point pos = p; pos *= r; point x = fract(pos); point i = pos - x; point c = point(sin(i[0]*2.0), sin(i[1]*2.0), 0.0)*0.2+0.2; return (((x[0] < x[1]) == (x[0] < 1.0 - x[1])) ? 1.0 : 0.0) * c; } shader color_squares( float Scale = 1.0, vector Vector = P, output color ColorOut = 0.8) { vector pos = Vector*Scale; float r = 20.0; point x = fract(pos*r); point i = pos*r - x; float w = 50.0; float l = clamp(0.0, 1.0, (0.5 - ab...

Color Mix Modes in Blender / Cycles

Imagen
Here there are a brief reference about color mix node and its modes (for further reference visit blender wiki ). This is the node setup I have used: Mode Mix - Factor 0.0 : only the first color appears.  Mode Mix - Factor 1.0 : only the second color appears. Mode Mix - Factor 0.5 : combines both colors with a weight of 0.5. Mode Add - Factor 1.0 : adds RGB components of the colors. . Mode Multiply - Factor 1.0 : multiplies the RGB components of the colors. Mode Subtract - Factor 1.0 : subtracts the colors values. Mode Divide - Factor 1.0 : divides the colors values. Mode Difference - Factor 1.0 :  Absolute value of the difference. Black for equal values and white for opposite values. Mode Screen - Factor 1.0 :  this is the opposite of multiply. See the wiki . Mode Burn - Factor 0.5 : See the wiki . Mode Burn - Factor 1.0 : See the wiki . Mode Dodge - Factor 1.0 : See the wiki . Mode Overlay - Factor ...