viernes, 31 de mayo de 2013

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 ""
*   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;

    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.


viernes, 24 de mayo de 2013

Blender Cycles OSL: Sierpinski Squares

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 ""
*   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++)
        result += genCheck(p,diExp) / i;

        diExp *= 2.0;
    result /= MaxIterations / 2.0;

    Fac = result;
    ColorOut = color(result,result,result);

This will be a basic render colored by the pattern:

I have applied this pattern to an anisotropic shader. This is the node setup:

 Here there are other renders and their node setups:

 And this is the node setup of my first render in this article:

The Scale and Zoom parameters can be used to see different levels of detail. In this renders I have used a Mapping node instead.

I hope you like them.


martes, 21 de mayo de 2013

Fabric Material for Upholstery II

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.


martes, 14 de mayo de 2013

Silk Material

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 ejemplo).


Hasta la vista

sábado, 11 de mayo de 2013

Glowing Lights Material

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.


miércoles, 8 de mayo de 2013

Semitransparent Fabric Material

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 (bands option):


lunes, 6 de mayo de 2013

Blender Cycles OSL: Color Squares

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 ""
*   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 - abs(x[0]-0.5))*w);
    l *= clamp(0.0, 1.0, (0.5 - abs(x[1]-0.5))*w);
    l *= clamp(0.0, 1.0, abs(x[0] - x[1])*w);
    l *= clamp(0.0, 1.0, abs(1.0 - x[0] - x[1])*w);
    point tc = tri(pos, r);
    tc += tri(pos, r*0.5);
    tc += tri(pos, r*0.25);
    tc += tri(pos, r*0.125);
    // Returns color
    ColorOut = color(tc*l);

The node setup for the material above is a simple diffuse node. But if you want it looks more like a present paper, you can add some glossiness with this setup:

This is the result:

Or this setup to get a more metallic finish, like a satin paper:


jueves, 2 de mayo de 2013

Blender Foolish Trick: Append a Particle System

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 post). Select the last object appended and delete it.

5) That's all. My old object with the new particle system. Now it is time to check the particles set up (number or particles, children) and fit them to its owner object.

Este sitio emplea cookies de Google para prestar sus servicios, para personalizar anuncios y para analizar el tráfico. Google recibe información sobre tu uso de este sitio web. Si utilizas este sitio web, se sobreentiende que aceptas el uso de cookies. Más información Entendido