Saturday, February 10, 2018

All in One Blender Matcaps Material

Everyone knows that in Blender 2.79 you can use only single Matcap shader per view. That is sometimes limiting and not so pretty. Especially if you have model with multiple parts.

And because matcap is based on an old Normal mapping technique I decided to make a material that can use specific matcap depending on the object's random number or by assigning specific index.
For this I made a screenshot of the matcaps preview panel and edited it slightly in Gimp. Then using the power of material nodes and some math it turned out like this.

From here you can amaze your unsuspecting friends by making multi-matcap candy ball.

Do you think this texture tiling deserves a tutorial?

Let me know!

Monday, February 5, 2018

Basic usage of Vertex Weight Proximity Modifier

Vertex Weight Proximity Modifier is a powerful modifier that can control vertex weights in given vertex group and vertex groups are widely used in other modifiers to control the amount of the modifications.

In this short tutorial I will show you how to set up a Vertex Weight Proximity Modifier in order to explore its properties. The tutorial is accompanied with short demo video that summarize some of the most important controls of the modifier.

You will need basic knowledge of mesh editing and modifiers to complete this tutorial.

Let's begin!

1. Create a Plane. Subdivide it in Edit Mode couple of times.

2. Select all vertices and add new Vertex Group. Leave it with the default name Group.

3. Create new object that will be the Target for the modifier. In this case I choose Cylinder without caps and very small height. Align it to the Plane.

4. Rename the Cylinder as Target.

5. Now add Vertex Weight Proximity Modifier to the Plane and set the Cylinder object as Target.

6. In the modifier's field Vertex Group select Group.

7. As Distance criteria choose Object. In this case the weights of the Group vertex group will be influenced by the distance to the center of the Target.

8. For Lowest value set 1, for Highest - 0. Those values are very important and explained at the end of this tutorial.

9. In order to see how Vertex Weight Proximity Modifier affects the selected vertex group let's add another modifier which will be controlled by the same vertex group.

10. Add Solidify modifier to the Plane add some Thickness (0.5) and select Group in vertex group field.

11. Move the Plane to the left and rename it to Plane_L. Then duplicate it and move the duplicate to the right. Leave the Target object in the middle. Rename the duplicate to Plane_R.

12. Select Plane_R and in its modifier stack change Distance option of the Vertex Weight Proximity Modifier to Geometry and then select Vertex as geometry element. In this case the weights of the vertex group will be influenced by the distance to the vertices of the Target.

If you set everything correctly you should end up with something similar to the image below. Don't be afraid to be creative and deviate from this look.

The final result: Two subdivided planes with modifiers and Cylinder object as influencer (Target)

Now, try moving the Target towards the center of the Plane_L. You will observe the Solidify modifier changing from no effect to full effect when both centers of the Plane_L and Target coincide.

Now move the Target towards the Plane_R you will notice that the Solidify modifier is in full effect where the vertices of the plane are closest to the vertices of the Target. You can now switch to other Geometry element of influence Edge or Face. All vertices closest to the edge or face will have their weight set to higher vertex wight and thus more influenced by the Solidify modifier.

The Vertex Weight Proximity Modifier has more controls as Falloff Type, Vertex Group Mask and Texture Mask, which give additional control over the modification of the vertex group.

You can see a demo of most of the options in this video:

So, now you can control the weights of the vertices depending on the distances to different parts of given object. Changing vertex weights gives control over the final result from other modifiers in the stack. In this way you can create various effects.

As final note the parameters Lowest and Highest have the following meaning:
Lowest (value) - maximal distance at which the vertices of the vertex group receive weight of 0.
Highest (value) - minimal distance at which the vertices of the vertex group receive weight of 1.

This is a bit confusing. So here are the settings used above explained:
Highest value of 0 means that vertices that are at distance of 0 to the target element will receive the highest vertex weight of 1 and Lowest value of 1, means that vertices that are at distance of 1 and above will receive lowest vertex weight of 0. So you can type any values in those fields and see how the vertex weight values of the Group change.

Subscribe, like, comment!
Enjoy your day!

Monday, January 29, 2018

Polygonize an image in Blender

Reducing an image to set of triangles is an interesting way to make abstract art but requires hours of careful placing of points and tedious colorizing of polygons. Of course there are programs that try to automate this process, but you as a true Blender user want to make everything in your favorite program. So, in this tutorial I will show you how to make polygonized images by couple of ways in Blender - applying some skills and knowledge from Modeling, Modifiers and UV mapping.

In this tutorial we will create the images shown above.

Let's begin!

Preparing the image plane

Start with a simple Plane object. The orientation of the object is not important. My preferences are to place it in XZ plane.
You can resize the Plane to the proportions of the image. For example if you intend to render 1920x1080, you can resize the dimensions to X - 1.920 and Z - 1.080.

Plane object aligned in XZ plane and rescaled to desired dimensions.

If you like squares leave the dimensions unchanged. Apply the scale and rotation before going further, just in case.

We will examine two types of polygonisation: abstract and concrete.

Abstract polygon background

In the abstract variant we will generate triangles that will take the color from given image without taking into account the underlying shapes.

Enable Wire and Draw All Edges in Display panel of Object Properties tab to better observe the changes.

1. Add Subdivision Surface modifier and set it to Simple.
2. Set Subdivisions - View to 6
3. Add Decimate modifier and set the Ratio to 0.1, also check Triangulate option.

Remeshing of the plane made simple.

You can play with the above settings to your liking.
4. Apply the modifiers in the order of creation.
5. With object selected tap Tab to enter edit mode. Select All vertices.
6. Press Spacebar and type Edge Split and execute the operation. All triangles are now split from each other and deselected.
7. In Front view Select All and press U -> Project from View (Bounds) to create UV map layer.
8. Switch from 3D View to UV/Image Editor change UV selection mode to Face and Rotation/Scaling pivot to Individual Origins as marked on the image below.

Editind UVs. From this...

.. to this after scaling the UV faces.

9. Press S to scale the polygons and type 0. Now the UV faces will pick single color from the texture.
10. Switch to 3D View again. Set the Viewport Shading to Rendered. Create a simple Shadeless material for the plane and add new texture to the material. I will use a Clouds texture with custom Ramp colors and settings for the Depth and Size. Make sure that Mapping coordinates are set to UV. The settings are shown below.

Create abstract backgrounds from procedural images...

... or photos.

With that the polygonization of the image texture is complete. You can experiment with any kind of textures including photos to see how they will look. Render cool abstract art!

Concrete image polygonization

In the concrete variant it is taken care of outlining the forms that we want to remain recognizable by the viewer.

Lets take for example this photo:

If we apply this image to the plane object that we created it will look like this:

For fresh viewer it will be hard to recognize what is on the image and here you have the opportunity to focus on specific parts of the image in order to make it look better.

You can always increase the polygon density in some parts, but if you want to keep the image low-poly you have to put your basic modeling skills at work. This approach requires more time and artistic look. Be patient!

Using the image as reference create new object, delete all vertices and start placing and connecting new vertices at strategic places - mostly where the edges of shapes are and where the texture is varying.

Try to keep the polygon count low, because this is the beauty of this art - showing more with less.

After creating the polygons (preferably triangles). UV unwrap the mesh as described above. This time you can load the reference image in the UV/Image editor to see exactly where the uv faces are located.


Here is my take on placing vertices at strategic places on the image, variations are unlimited.

After finishing with the modeling repeat the steps from No. 5 as instructed above to achieve the low-poly look.

Polygonization of an image with attention to the details. Compare with the polygonized image using the first method.

A great thing of this method is that you can always change the colors of the polygons by simply moving around the scaled down UVs in the UV/Image editor. Make sure Proportional Editing is enabled and the size of the falloff is set to very small value so the vertices of the faces stay toghether.

Improved image by moving around the uv polygons and placing them on different pixels.

With that the tutorial is complete.

The technique described here could be a base for creating various low-poly effects and animations and it's not limited to 2D mesh ot triangle polygons.

Like the examples below.

If you like this content follow me on Twitter for updates and new cool stuff!
Happy polygonizing!