Entradas

Mostrando entradas de mayo, 2013

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: 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++)     {   ...

Fabric Material for Upholstery II

Imagen
Hi everybody. Today I'm going to show you another fabric material for upholstery, similar to one explained here . It looks so: The structure is the same than the first version. The only changes are the cloth pattern and the colors of the material. The fabric material ( SynthFabric node ) is explained in my previous post . This time the cloth pattern uses a RGB Curves node to get the cloth texture. In my first material I used a power and a color ramp node instead to create the texture. This is the render with the same color than my first version. I hope you like it. Bye

Silk Material

Imagen
Hi everybody. Today I'm going to show you a silk material: Hola a todos. Hoy voy a mostraros un material de tipo seda: The node setup cosists of two blocks: - The silk material, made with a glossy and a velvet node. - The cloth pattern, used for texturing and slightly bumping. La configuración de nodos se compone de dos bloques: - El material seda, hecho con un nodo de brillo y uno de terciopelo. - El patrón de la tela, usado para la textura y un ligero relieve. The colors used are: * Color ramp node: from #7D2A2A to #CA4949 * Velvet node: #A83B3B Los colores usados son: * Nodo Color ramp: desde #7D2A2A hasta #CA4949 * Nodo Velvet: #A83B3B And the pattern is made so: Y el patrón se hace así: I have used a Wave texture node to distort ramdomly the noise texture node (see example image on the right hand side). He usado una nodo de textura Wave para distorsionar aleatoriamente otro nodo de textura Noise (vea el lado derecho de la imagen de e...

Glowing Lights Material

Imagen
Hi everybody. Today I'm going to show you a glowing material, similar to neon lights. There are several node setups here in BlenderArtist, but normally in the reder I have seen a burn spot in this kind of materials. You can add a glass effect to the material mixing the emission node with a glossy node and a fresnel factor. Something like this: Change the fresnel and roughness values to get different classes of glass. Note that the emission strength value should be set up in accordance with the rest of lights in the rendered scene (lamps or meshlights). Therefore this value could be higher or lower in your scene, depending on the values of the other lights. In my test scene I have removed the top lights to highlight the glowing effect. Bye

Semitransparent Fabric Material

Imagen
Hi all. Today I'm going to show you a semitransparent fabric material: The node setup is similar to the material explained in this previous article .  I have added a transparent node mixed to the fabric material. The greater than node controls the level of transparence of the fabric. The SynthFabric Node is the same that the one which appears in the article mentioned above . The fabric pattern is simple, It just is a subtraction of two wave textures with different scales and distortions ( band s option): 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...

Blender Foolish Trick: Append a Particle System

Imagen
If you want to append a particle system from another blend file, you have noted that you don't have that option (see this post about append materials or node groups). But you can do that easily following these steps ( Cycles or Blender Internal ): 1) In my example I want to change the strands of a carpet. Do the first three steps from the post above , selecting a blender file which has one object with the new particle system. Then select the Object directory and that object in the list. The object will appear in your scene. If you can not see it, it will be out of the camera view. Drag and drop it inside this. 2) Select the carpet or the object you want to change its particle system. 3) Go to Properties window >> Particle System button >> Settings , click in the stars button and select the new particle system (in this case Fur26 ) 4) Now I have the carpet with the new appended strands (if you want compare the image with the first in this...