Logo 3.5Cats_AndHalfAFish


Walls (part 2).

April 30, 2020 Shade, Godot, 3d, Blender, modeling, textures, Gimp
The struggle continues.

Note : Blender 2.82, Godot 3.2.1.

In the previous post, I talked about a lot of things having to do with normal maps. This post will be more of a collection of 'this and that'. Things I stumbled upon and would prefer not to forget again while working on this project. =)


Simplify. Simplify. Simplify.

First important lesson in modeling for games : don't try to create things as they are in real life. Omit small(ish) details and simplify what is high above eye level. Players will not pay attention to them anyway, so it is wasted effort and cpu.

Simplify the use of textures.
For now, my models seem to be ok with just a diffuse texture and a normal map.

Screenshot from inside Godot, showing the new walls, ceiling, and pilars.
Screenshot from Blender showing the new walls, ceiling, and pilars.

The assets shown in the screenshot use 3 different diffuse 1K textures. The diffuse textures for the pilars and ceiling are based on the diffuse texture for the walls. They were all created in Gimp, starting with a CC0 cement texture.
It is important to keep the color scheme coherent or else assets will look 'wrong'. Light(er)/neutral textures seem to work best.

Blender materials library.

Continuing on with the idea of a coherent color scheme, I also try to limit the amount of materials to be used in Godot.
To that end, I have started a 'materials library' in Blender.

Blender materials library.
Blender materials library.

It's really just a Blender file with a cube for each material I use in the project.
Whenever I need a particular material for an asset, I can just 'append' it from this library :

Blender : append a material from the library (1).

The filter (bottom left) makes it easy to find what you're looking for (objects, materials, ...) :

Blender : append a material from the library (2).

The material is now available in the new project through the material properties panel (dropdown).

Cleaning up textures and materials in Blender.

After working in the same Blender file for a while, trying things out, I usually end up with a long list of unused textures and materials that I can't seem to get rid of (clutter !).
I found a BlenderArtists post (from 2016) talking about exactly that. The correct way to delete a material in Blender, seems to be to first unlink all textures ... Not doing that keeps the textures linked inside the Blender file.

Fortunately, cleaning up old textures is easy.
Switch to the Shading workspace, where you'll find a small Image Editor window (bottom left). Select an unwanted texture from the dropdown, and next, shift+click the button with the cross to force the number of users to 0.

Cleaning up textures in Blender (1). Cleaning up textures in Blender (2). Cleaning up textures in Blender (3).

Now, you can save and reopen the Blender file for automatic deletion. Or, you can go to the outliner (top right) > switch to the orphan data panel > select what you want deleted > right click > delete :

Cleaning up textures in Blender (4).

In a similar way, you can get rid of unwanted materials.
Go to the Material properties panel, select a material from the dropdown list, and next shift+click the button with the cross.

Packing textures in Blender.

I like 'packing' my final textures into my Blender files. This way, I don't have to worry when I'm moving my Blender files around ; the textures will always be there.
I usually do this while I'm in the Shading workspace, through the Image editor.
Just select the image you want to pack, click the hamburger menu button, select Image : pack.

Texture packing in Blender.

Blender : uv unwrap.

Another neat trick I stumbled upon can be found in the UV Editor workspace.
Press 'n' to make the properties panel visble on the right side of the uv space, and switch to the View tab. Unfold the Overlays panel (in the Display section), and check Stretching. I find the 'area' type quite useful.

UV unwrapping in Blender.

Usually, a bit of scaling and moving verts around gets you where you want to go :

UV unwrapping in Blender : stretched ! UV unwrapping in Blender : no stretch.
Blender uv unwrap : using the 'stretch' overlay.

Blender : misc.

• Before uv-unwrapping a model, it's a good idea to 'apply (rotation and) scale' (ctrl+a).
On occasion, I've had this error message :

Blender : error applying scale.

There are a couple of places where you can make a model 'single user', but sometimes only this seems to work :

Blender : make single user.

• If you ever need to convert a polygon face into quads, then this is an easy way to do it : select the face > right click > triangulate faces (ctrl+t) > right click > tris to quads (alt+j).

• In a tuturial, I came across 2 useful addons : 'looptools' and 'quick pipe'.
The 'looptools' addon can be activated from the preferences panel, and it can for instance be used to convert a square into a circle (in edit mode), or to 'bridge' 2 edges. For a quick demonstration, watch the Grant Abbitt video mentioned below.

The 'quick pipe' addon can be downloaded from BlenderArtist and installed (and activated) through the preferences panel. It's a neat way to easily create pipes from mesh edges. To convert the curves to meshes, right click, and select 'convert to mesh'.

An alternative to the 'quick pipe' addon, is the 'skin modifier' as mentioned in this post on StackExchange.
Use ctrl+a in edit mode to scale the thickness.

Progress so far ...

Even though it has been very slow going, I'm quite pleased with the result so far. I updated the pilars, walls and ceiling for an area that's mirorred on both sides of the castle, and imported the whole lot into Godot (Yes, bad lighting ! And yes, bad camera angles !).

Godot : progress(1). Godot : progress(2). Godot : progress(3).

I don't think these models are final yet, but it's a nice start.
The next step for this area will be the floor. I think I will keep the windows (stained glass ?) for later.

Gagh ! After spending a lot of time in Blender and Gimp, I have now completely forgotten how to code ...

List of relevant tutorials.