× Phaseshift FCOM Tutorials

Texture painting pixel art onto a mesh in Blender


Learn how to stencil pixel decals onto low poly models for a PS1 look

Context and Focus


This article describes a workflow on creating modular 3D assets for a low-poly PS1 era game. This covers texture painting onto the 3D models, not the creation of the 3D models or the 2D decals to stencil onto the model. Some recommendations are to download a couple of plug-ins for Blender. These include Texel Density Checker to ensure consistent pixel size across all of your objects. A link is available at the end ofthis tutorial. 

This tutorial describes a vehicle (bike) that is comprised of lots of different objects that need to be textured and scaled the same way. The bike is made up of these objects, and can be switched out so the player can customise the livery and built parts of their vehicle. It is important in this application that all pixels are the same size to ensure continuity of the art style for this game.

Preparing the work space


We are using Blender 5.1 for this tutorial, and extensively use the workspace window layouts extensively to ensure consistent editing (and knowing where each button is!) 

First off, we need to configure the grid. Ideally this should be done before creation of the model to make sure each vertice is pixel perfect.

Click on viewport overlays and make sure the scale and subdivisions are as you see here

Click on the viewport overlays, and make sure the scale is set to 0.625, and subdivisions to 16. If subdivisions are grayed out, you may need to set the Units under Scene settings, like below:

Just set to none to allow changing of grid subdivisions

Preparing the 3D objects


For each of the objects we want to texture paint, we need to make sure they are exactly matched to the grid. Click on an object, go into Edit Mode, select all vertices (Ctrl + A) and then click (Shift+S) to bring up the selection menu, then click Selection To Grid. This will align all the vertices neatly on the grid. You may find your shape to change, but will be minimal.

It's a good idea to make sure your mesh is also 'pixel perfect'

Next, we need to check the texel density is the same on all objects. This is essentially the 'relative size' of all objects in the scene. UV unwrap your objects (Edit Mode, click on Object click 'U', then whichever fits your use case, I recommend Smart UV Unwrap). 

One way to help visually check this is to assign a material to all of the objects. Assign a texel checker texture to this material. Make sure to align and scale the texels on each object so they match, like the screenshot below (mind the black splodges, had been testing some painting!)

If done correctly, each of the boxes should be the exact same size

To bring up the Texel Density Checker (assuming you've installed it) in Edit Mode, press N, then click Texel Density Checker. Click 'Calculate TD' and 'Set TD' to make sure each of your objects have the same texel density. You can change the size of your texture and 'Half TD' and 'Double TD' to give greater or lesser resolution depending on the amount of detail you want to show on your texture. Always try and use the smallest possible resolution for a texture you can to improve performance.

As long as everything is the correct size and the UVs look okay, you should be good to go.

Painting


Now click on the top layouts bar where it says 'Texture Paint'. Click on the object you want to paint, click a brush and viola! To paint a pixelated pattern, I would recommend the 'Hard Brush' and set strength to 1. We want a very hard, non-blended, non anti-aliased effect for pixel art and this helps. Another useful setting on brushes is the 'Falloff' setting. This allows an all or nothing approach to applying paint.

Click on the very end button for 'Constant preset'

Click on your brush, then Tools -> Brush Settings -> Falloff. Click the Constant preset button at the end (upside down bracket).

Stenciling


This is where things getting smart and complicated. In my use case I want to stencil pre-built pixel art decals that I will use across the texturing of different parts. I want a consistent look and scale to all future parts I also create. 

First off I created a document of all kinds of pixel art decals I want to use. I'm not going to show you how to create these - but you can use any kind of PNG/Vector/Image anything you like. In this context I want manufacturer sponsor decals to decorate my vehicle liveries. To start, create a new brush. You can simply duplicate your current brush, then name it something useful like 'Brush001TestCopyACTUAL'. Naw for real I'm gonna call it 'Sponsor_Vortex'.

With the brush selected, navigate to the texture properties, then click Open Image to assign your decal to the brush. This might look a bit silly.

We can sort out the aspect in a sec

Back in the Tool menu with the brush still selected, click on Mapping -> Stencil, then Image Aspect to correctly the set the aspect ratio of the loaded image.

Looking a little better

When you hover your mouse over the Texture Paint window you should now see something like this:

Stencil is a little bit big

So our stencil is there, but it's a bit big. We can move the stencil about by right clicking on it and dragging it around our scene. You can scale it by pressing (Shift + S) then right-click and moving the mouse to scale the stencil. Them move the camera around to where you want the stencil, then paint it on.

Then voila! Decal painted nicely on your model.

Make sure to align the angle of your decal, and try your best to align with the grid to make it pixel perfect

Documentation


To explore more on these topics, check out the documentation:

Texel Density Checker

Liked this article?

Please consider sharing!
Author

Josh Lyell

Game Developer