Sharing my Blender setup and tips

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
User avatar
valerian
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Nov 04, 2019 4:27 pm
Contact:

Sharing my Blender setup and tips

Post by valerian »

factorio_TrnoAEkPtM.jpg
factorio_TrnoAEkPtM.jpg (283.29 KiB) Viewed 602 times
blender_CmvSgMkuNI.jpg
blender_CmvSgMkuNI.jpg (530.11 KiB) Viewed 602 times

Introduction

I want to share to the community the Blender file I used to render my mod Large Storage Tank.

When I started making this mod, my goal was to create a larger storage tank, with visuals that matched the vanilla look of the game. I was hoping to find some guides or samples online to achieve that look, but after some research I realized that there was almost nothing.

I gave myself that interesting challenge, to see if I could achieve that vanilla look, and I think the result is quite decent now.

What I made might not be perfect, but I believe it can be useful for anyone who wants to start creating new buildings for Factorio today. This is the kind of file I wish I could have found when I started.

Here is the Blender project file: https://drive.google.com/file/d/1BRoZmb ... 3eno0/view
It was made using Blender 3.3, it seems to work fine too with the newest Blender versions, but for some reason the rivets around the tank windows got wrongly rotated.


I will try to explain a few things about how it was made, do not hesitate to ask questions if it’s unclear or if you want to know more, or to correct me if I’m wrong on some topic.

The tips I will give here are intended for people already somewhat familiar with Blender, who are looking for specific settings to render for Factorio.

I have made this project almost 2 years ago with the intent to share it, but I have been a bit lazy about it until today, so unfortunately I had to try to remember some of what I did or decisions I made, and I may repeat here some tips already existing online, which may be better explained than mine.
Matching the light and colors of Factorio
The sun and the camera

I spent quite some time and attention matching the sun rays angle, so that the shadow of the pipes would perfectly match.
It’s probably not the exact values, but in my case this is what seemed to work:

Camera: orthographic, at an angle of 45°.
Sun: assuming we are looking towards the north, the sun starting from a vertically centered position in the sky, should be rotated along the N-S axis 39.3° to the west, and then rotated along the vertical axis away from you by 5°.

In my case this is what it translates to:

Camera:
X: 45°
Y: 0°
Z: 180°

Sun:
X: 0°
Y: 39.3°
Z: 5°

Ambient light and color management

This part is clearly subjective.
I quickly realized that in Render Properties, the default “Filmic” color management view transform of modern Blender, meant to look realistic, didn’t match with the more “gaming” look of Factorio.

After a lot of trial and error, I ended up with some settings that I was satisfied with:
View Transform: Standard
Look: Medium High Contrast
Exposure: -0.150

In World Properties, my ambient light is set to pure white with strength at “0.055”, which in the end is close but a bit darker than Blender’s default.

With those settings the pipe cover sprites that I imported from the game seem to get rendered with the proper colors when I compare them to other game sprite that have pipe covers.

Blending with the ground

To better blend with the ground in game, I added ambient occlusion shadows, as well as an invisible brown ground, that would reflect back a bit of its color to the bottom of the building and block ambient light from below, to make it more real.

For the ambient occlusion, I used a ground plane with a shader that uses the ambient occlusion node, on which I applied a few tweaks to only keep the dark part and turn the rest transparent, among other stuff.

For the “invisible” brown ground, I went to Object Properties > Visibility > Ray Visibility, and unchecked “Camera”, so that we can’t directly see it, but that it can still affect the light as if it was there.



Before
Before
blender_RlIQOOm3Y7.jpg (647.32 KiB) Viewed 602 times
After
After
blender_sUW6gi6m0F.jpg (612.83 KiB) Viewed 602 times
Rendering the entity and the shadow to separate files
Buildings in Factorio mods require 2 separate sprites: the building without shadow, and a shadow sprite with a mix of black and transparent pixels.

In order to achieve that without much struggle, here is how I proceed:

First I focussed on rendering the building itself, with a transparent background.

Then I made a new view layer in Blender, allowing two different ways of rendering the same scene. In each view layer, I can select which entities are included or not.

blender_AtOhTdRuAQ.png
blender_AtOhTdRuAQ.png (225.54 KiB) Viewed 602 times

Shadow render

For the shadow layer, I had mostly the same things as the main layer, and made two specific changes:
I added a shadow catcher plane on the ground, with that option enabled: Object Properties > Visibility > Shadow Catcher. This makes it render shadows it receives, while being fully transparent where there are no shadows.

In View Layer Properties, all the way to the bottom, I set Material Override to a black material.

With those two changes, the render should look all dark with no colors, and a semi-transparent shadow on the ground.

blender_ArXZ5lkdLo.png
blender_ArXZ5lkdLo.png (61.23 KiB) Viewed 602 times
blender_l57CkEg4PH.png
blender_l57CkEg4PH.png (282.52 KiB) Viewed 602 times

Compositing

In the compositing panel of Blender, I can tell it what to do with the two view layers: render each one to a different file, and apply some filter on the shadow layer so that it looks fully made of black and transparent pixels, without any shade in between.


blender_mcj4Sifmoy.png
blender_mcj4Sifmoy.png (437.9 KiB) Viewed 602 times


hr-large-storage-tank.png
hr-large-storage-tank.png (204.79 KiB) Viewed 602 times
hr-large-storage-tank-shadow.png
hr-large-storage-tank-shadow.png (37.35 KiB) Viewed 602 times

User avatar
Brathahn
Fast Inserter
Fast Inserter
Posts: 125
Joined: Sat Aug 02, 2014 1:50 pm
Contact:

Re: Sharing my Blender setup and tips

Post by Brathahn »

Thank you for your nice work and good explanation!
This should be in a factorio wiki article about making your own graphics for mods.

User avatar
dog80
Filter Inserter
Filter Inserter
Posts: 287
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: Sharing my Blender setup and tips

Post by dog80 »

looks really authentic

Tserup
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jul 04, 2023 4:29 pm
Contact:

Re: Sharing my Blender setup and tips

Post by Tserup »

Thank you for the tutorial, it improved my texture effects quite a bit. Also, I'd like to ask how to create a color mask layer.

User avatar
jamiechi1
Fast Inserter
Fast Inserter
Posts: 244
Joined: Wed Jan 03, 2018 10:12 pm

Re: Sharing my Blender setup and tips

Post by jamiechi1 »

I have used Blender in the past but prefer Rhino.
In any case, thank you very much for this information. It is very helpful.

Post Reply

Return to “Modding discussion”