Implementing effects by drawing vertices

Some time ago, I came across an interesting X: Rebirth - Geometric Lensflares post on simonschreibt.de

In this post, the author talked about how X: Rebirth uses vertex painting techniques to create lens flare effects. Why is this interesting? Because modern computers do a great job of rendering triangles and geometry, but they experience little difficulty in rendering textures. That is why you most likely saw examples of poor texturing in games or poor texture quality even at maximum settings - all these artifacts are caused by image compression. Textures are useful in creating characters, items, and resources, but sometimes they are not enough to create effects. Most effects in games are presented in the form of simple shapes, such as shining or flickering. If you try to use textures for effects, you will encounter compression problems. Yes, their shape is simple,but we need to get the maximum quality of this form.

The X: Rebirth development team ran into this problem and decided to use vertex coloring to implement some effects. Their only limitation was the number of triangles. If you want to achieve the highest quality effect, then you have to deal with restrictions. In the case of textures, such restrictions are compression, file size, and in the case of drawing vertices, the number of model polygons.


Each vertex has its own color. Drawing vertices in Blender.

To color the vertices, the number of triangles is critical. The color of the model will be mathematically calculated by interpolation between the vertices. This will create a gradient transition from one vertex to another, but we are limited to one color per vertex.

So how do you create effects using vertex painting techniques? It is quite simple, even if you are not an artist. Yes, if you are a professional in vertex drawing, you can create effects much more optimally (as is done in X: Rebirth), but it takes a lot of time, and I will tell you how to do everything in semi-automatic mode.

If you studied the simonschreibt.de website, you might find another interesting vertex coloring method used in Homeworld games.. The idea of ​​creating complex backgrounds exclusively by painting vertices gave me the idea of ​​transferring some effects using Blender.

Blender has awesome features today, but we need an old version. Blender 2.74 is the best choice because newer versions do not support older types of baking. We will also need the free Weight-and-Color plugin created by chebhou (there is another option if you do not want to use plugins or older versions of Blender).

Upload the image to Blender 2.74 and duplicate the model with your image. We will need to separate this model using subdivide to a fairly dense mesh.


Image uploaded as a plane using the Images as planes addon


For simple mesh splitting, the Subdivision surface modifier is used.

After that, add the vertex color to the high-resolution mesh so that the baking tool knows where to write the data.


Added vertex color data


Roasting options We start the

roasting process by first selecting an image and then a high-resolution model. Go to the baking tab and press Bake to Vertex color, and then Selected to Active.


After baking, the beautiful colors of the vertices should be baked on the model. To improve visualization, you can create material.

After baking is completed, press Space on the keyboard and enter “weight & color”, use the parameters “Vertex color to weight” and “gray scale”.


To open this menu, press the space bar in object mode


Now we need to add the Displacement modifier and use the newly created weight data as a modifier determinant. We created a height map based on our texture. We needed to do this, because Blender uses some algorithms to thin out the geometry (Decimate modifier). Thus, we told Blender that there are shapes in our geometry, and in the future, during thinning, Blender will not treat the mesh like a regular plane.


Displacement modifier


For clarity, you can scale the model again to the dimensions of the plane.

It's time to add the Decimate modifier. This modifier reduces the number of polygons of the model, while maintaining its overall shape. This step requires manual configuration.


Plain Decimate


Decimate with determinant

As a result of manual tuning, you can get quite interesting results. For this example, I used my own high-resolution model. I did a rough trace of the forms with the knife tool, and then applied subdivide.


This is how I got the effects using vertex coloring. You may not use the old Blender and the plugin for this. All this can be done in modern Blender, but there may be problems with the Displacement modifier if you try to use an image as input, and you fail to use your own determinant in the process of thinning out the geometry (Decimate modifier).

All Articles