miércoles, 22 de enero de 2014

Testing CGTrace's Material Ball

Hi. I have been testing the CGTrace's Material Ball:

Carpaint:


Colombia Gold:


 Blood:


Its author, Victor Borges says that it is similar to other testing scenes used with Mono software. I really like the color strips beside the ball and the scene loads and renders faster than @Tuqueque's Blender Ball. However I think it can be improved. I will continue making tests and post them here in this article.


These are more screenshots with the scene modified:
  • Blood:
  • Colored Glass:
  • Brown Leather:

These are the tweaks I have done on the blendswap scene:
  • Recalculating all normals
  • Changing Diffuse materials to roughness 0.1, so they use Oren-Nayard algorithm
  • Changing Color light to Blackbody 6500 (like a fluorescent or white LED light)
  • Adding a Cube which wraps all the objects, so the black world is not reflected. Its material is Diffuse RGB(0.6, 0.6, 0.6) and roughness 0.1.
Bye.

lunes, 13 de enero de 2014

Plastic for Appliances Material

Hi everybody. Today I'm going to show you a simple material, plastic for home or computer appliances.

Hola a todos. Hoy voy a mostraros un material simple, plástico para aparatos domésticos o de informática.

This is my first approach: 

Ésta es mi primera aproximación:


The material is basic: a mix between Diffuse and Glossy shaders. I have used a Facing factor for mixing, because I think it works better with this kind of materials which are not very glossy. As you know Facing reflections only are shown when you see the surface in a grazing angles.

Also I have added a Voronoi Texture to get a rough effect on the surface. This is the node setup:

El material es básico: una mezcla entre shaders difuso y de brillo (Glossy). He usado un factor Facing para la mezcla, ya que creo que funciona mejor para este tipo de materiales no muy brillantes. Como ya sabéis las reflexiones de tipo Facing sólo se muestran cuando ves la superficie en ángulos casi paralelos a ésta.

También he añadido un textura de tipo Voronoi para dar un aspecto rugoso a la superficie. Esta es la configuración de nodos:


Also we can modify the material to show a spotty or grainy color.

También podemos modificar el material para mostrar un color moteado o granuloso:


Just plug the Voronoi Texture into a Color Ramp and then you can colorize the material with little spots.

Sólo tiene que conectar la textura Voronoi en una rampa de color y entonces usted puede colorear el material con pequeños puntos.


And finally we can change the Voronoi Texture node for a Noise Texture node, getting a similar result.

Y finalmente podemos cambiar el nodo de textura Voronoi por por un nodo de textura de Ruido (Noise), obteniendo un resultado similar.

 

Bye

Hasta la vista

martes, 7 de enero de 2014

Blender Cycles OSL: Mandelbrot Fractal

Hi. Today I'm going to show you an OSL code to get a Mandelbrot Fractal, like this:



This fractal uses the following complex numbers formula:

Z(n+1) = Z(n) ^ 2  + C

I have parameterized the exponent of the formula and the bailout value, that is, the value to stop the iterations. So the code is this:

shader mandelbrot_fractal_zn_zoom(
    float Scale = 1.0,
    float Zoom = 3.5,
    vector Vector = (vector)P,    
    float CenterX = 0.0,
    float CenterY = 0.0,
    int MaxIterations = 64,
    int Exponent = 2,
    float Bailout = 2.0,
    output float Fac = 0.0)
{
    point p = (point)Vector*Scale/(2*Zoom);
    int i = 0;
    int j = 0;
    int prevIteration = MaxIterations;
    float factor = 0.0;
    float foo = 0.0;
  
    // Starting point
    p[0] += CenterX;
    p[1] += CenterY;
 
    // Initialize 
    point pa = point(0.0);
    point pb = point(0.0);
    point pc = point(0.0);
    
    // Mandelbrot algorithm
    do
    {
        // z^j
        for(j = 1; j < Exponent; j++) {
            pc[0] = pa[0] * pb[0] - pa[1] * pb[1];
            pc[1] = pa[0] * pb[1] + pa[1] * pb[0];

            // for next product
            pb[0] = pc[0];
            pb[1] = pc[1];
        }

        // z^exponent + c
        pa = pc + p;
        pb[0] = pa[0];
        pb[1] = pa[1];
       
        i++;

        if ((prevIteration == MaxIterations) && (sqrt((pa[0]*pa[0]) + (pa[1]*pa[1])) > Bailout)) {
            prevIteration = i + 1;
        }        
    } while (i < prevIteration);
 
    // Factor to colorize
    factor = float(i);
    foo = sqrt((pa[0]*pa[0]) + (pa[1]*pa[1]));
    factor = factor - (log(log(foo))/log(Bailout));
    factor = factor / float(MaxIterations); 
  
    Fac = factor;
}

And this is the node setup to get the image before:


As it is using a exponential formula, if you change the exponent you can get another fractals (the power node and the color ramp could be slightly different):
  • Exponent 3

  • Exponent 4
  • Exponent 6
  • Exponent 7
  • Exponent 8
  • Exponent 9
  • Exponent 11


You can see other fractal renders using this code here.


Bye

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