Back to top

BETY
VEGA

Technical Artist | Game Developer

Bety Vega

Projects

Restore it Yourself Studio

Put yourself in the shoes of a restorer while you clean, repair, and varnish famous paintings of the western world!
Download demo! (Not fully optimized yet)

Creating the Painting

I designed a tool to create the paintings based on an image input. The mesh's size and UVs adjust to the proportions of the original image. To create a mesh through code, vertex, triangles, and UVs are needed. First, I got the aspect ratio of the painting.
Code for aspect ratio calculation
This mesh is made to have x numbers of faces, front and back (like a grid). So, based on the aspect ratio, I created the faces, first of the front, then of the back with an offset representing the thickness of the canvas. Then, I created the triangles in the correct order, so that their normal would face the correct way.
Triangle order diagram
Finally, I did the UVs. I wanted to have all the textures in the same material. Therefore, I determined that the painting per se would occupy the first half of the UV space, while the canvas texture would be on the other half. The tricky part was the thickness, as it can vary on size. So, what I did was to put their vertex UVs "inside" the canvas texture, so that the texturing would be seamless. The needed deformations are carried out in the shader, like the canvas texture tiling, etc.
Mesh UVs UV explanation

Damaging the Painting

I created a shader to generate "procedural" damage to the painting. I imported packed noises with different characteristics. I combined them changing their tiling and offset, and using dot product.
Crack noise texture
But this is not procedural enough. I wanted to achieve a crack-like noise, so I used a Voronoi noise, which is completely different if you change its values. However, this particular node doesn't let me access and modify the edges of the cells. Consequently, I made a Custom Voronoi node using hlsl based on Íñigo Quilez's one. This function calculates the distance from edges, so I can make them thinner or thicker. the distance I distorted it by plugging in the combined noises into its UVs.
Custom crack shader HLSL code
I exposed different parameters that are updated randomly each time a painting is selected. This texture is then integrated into the painting shader as a mask and as a heightmap for parallax occlusion mapping.
Crack creator interface

Painting on the Painting

I designed a painting mechanism using shaders and Custom Render Textures. First, I obtained the UV coordinates through the mouse position. Using the past and current position, I calculated different vectors and their projections, as well as length and lerps to get a smooth line.
Painting coordinates Line creation
I imported different brush alphas. Using the past mathematical operations, I distorted their UVs so that the alpha "drags" to the brush position. Also note that it is possible to change the brush sizes.
This is a texture that feeds itself to get that brush stroke. Then, I used another Custom Render Texture to bake the different brushes into one single texture.
Texture baking

Extras

Painting texture Canvas texture
I designed the painting and canvas textures in Adobe Substance.
I created a hover shader with a very subtle fresnel animation to indicate which things are interactable.
The easel adjusts automatically to the painting's height.
Trim sheet
I created trimsheets for the walls.

Contact me

Logo