32bpp 3D Graphics Development Tutorial

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
ikarus
Engineer
Engineer
Posts: 48
Joined: 09 Dec 2007 19:13

32bpp 3D Graphics Development Tutorial

Post by ikarus »

Hello all,

Like many on the forum, I recently got back into OTTD. Wonderful to see the community still alive after this many years and the great NewGRFs that have been released.

I'd like to try my hands at some 32bit graphics in 3D, but am struggling to find instructions for that. The wiki is 12 years old and the old 32bpp guidelines are no longer working and/or linked blender templates are not available; I can't get zBase working either.

But CZTR works and looks wonderful, so it is possible. But I haven't found their github repo.

Would highly appreciate any pointers towards 32bpp 3D development if you have them. E.g.:

- blender templates to generate sprites in all views from a single model
- dimension guidelines - how wide is a road supposed to be?
- is the .tar + png format still working?

Thanks!
User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3427
Joined: 24 Apr 2007 09:37
Skype: Discord: Emperor Jake #4106
Location: Not Actually Japan
Contact:

Re: 32bpp 3D Graphics Development Tutorial

Post by Emperor Jake »

ikarus wrote: 27 Jan 2024 15:46
I'd like to try my hands at some 32bit graphics in 3D, but am struggling to find instructions for that. The wiki is 12 years old and the old 32bpp guidelines
The old format 32bpp/extrazoom project (which required separate png's) is completely outdated and unsupported. For over a decade it's been possible to integrate 32bpp and/or extrazoom graphics directly into NewGRFs. As an aside, 32bpp and extrazoom are two different things and graphics can be neither, either, or both. 32bpp refers to the amount of colours per pixel (i.e. not limited to the old 256 colour palette) and extrazoom refers to the higher resolution sprites.

While graphics can still be made using Blender, nowadays a more popular method is voxel rendering using MagicaVoxel. There's a comprehensive video tutorial here: https://www.youtube.com/playlist?list=P ... aBDqtsYmBs

Check out GETS and Timberwolf's Trains for NewGRFs made using this method. IMO they match the game's art style better than zBase or CZTR :)

By the way, zBase is a baseset, not a NewGRF, so you'll find a way to enable it in the game settings rather than the NewGRF settings.

Hope this helps!
User avatar
ikarus
Engineer
Engineer
Posts: 48
Joined: 09 Dec 2007 19:13

Re: 32bpp 3D Graphics Development Tutorial

Post by ikarus »

Emperor Jake wrote: 28 Jan 2024 09:39 As an aside, 32bpp and extrazoom are two different things and graphics can be neither, either, or both. 32bpp refers to the amount of colours per pixel (i.e. not limited to the old 256 colour palette) and extrazoom refers to the higher resolution sprites.
Thanks for the clarification. I do mean both - 32bpp and extrazoom.
Emperor Jake wrote: 28 Jan 2024 09:39 While graphics can still be made using Blender, nowadays a more popular method is voxel rendering using MagicaVoxel. There's a comprehensive video tutorial here: https://www.youtube.com/playlist?list=P ... aBDqtsYmBs

Check out GETS and Timberwolf's Trains for NewGRFs made using this method. IMO they match the game's art style better than zBase or CZTR :)
Thanks, I had a quick view. The videos seem focused on vehicles. But first I'd like to try my hands at rails. Any specs for that? e.g. given a 100x100 voxel base, how wide is a road/rail.

I'd still prefer working in actual 3D.
Emperor Jake wrote: 28 Jan 2024 09:39 By the way, zBase is a baseset, not a NewGRF, so you'll find a way to enable it in the game settings rather than the NewGRF settings.

Hope this helps!
Ah, yeah, that makes sense. Thanks. And yeah, definitely helpful!
User avatar
SaltMakaroni
Engineer
Engineer
Posts: 10
Joined: 26 Feb 2022 11:57
Skype: Discord: SosMakaroni#2841
Location: Hungary, Budapest

Re: 32bpp 3D Graphics Development Tutorial

Post by SaltMakaroni »

ikarus wrote: 28 Jan 2024 13:38
Thanks, I had a quick view. The videos seem focused on vehicles. But first I'd like to try my hands at rails. Any specs for that? e.g. given a 100x100 voxel base, how wide is a road/rail.
You define the size in voxels, and then the render must be set to the needs of openttd.

What I use to rail render:
Rail.json

...
"size": { _______________My voxel model size, but you choose the size
"x": 178,
"y": 178,
"z": 255
},
"render_elevation": 30,
"sprites": [
{
"angle": 45,
"width": 64, _______Important! Fix Openttd sprite size
"flip": true
},
...
Attachments
1x
1x
vsin1_1x_8bpp.png (1.72 KiB) Viewed 809 times
4x zoom
4x zoom
vsin1_4x_8bpp.png (10.57 KiB) Viewed 809 times
Voxel
Voxel
Képernyőkép 2024-01-31 170941.png (18.69 KiB) Viewed 809 times
Hungarian Voxel World developer
Voxel, drawing, coding hungarian vehicles
Stadler Image Tatra Image Ganz Image
User avatar
ikarus
Engineer
Engineer
Posts: 48
Joined: 09 Dec 2007 19:13

Re: 32bpp 3D Graphics Development Tutorial

Post by ikarus »

SaltMakaroni wrote: 31 Jan 2024 16:17 You define the size in voxels, and then the render must be set to the needs of openttd.
Thanks for that!

Maybe I'm too pedantic. What I mean though are specs regarding width of the track or height of a tunnel. If the rail is too wide, it will not fit in a bridge. Since it's voxel, it would have to be a percentage of the square.

I also wonder if it's because of unclear specs that Timberwolf adjusts the height scaling when rendering sprites. Though he admits to creating "oversized" sprites.
User avatar
SaltMakaroni
Engineer
Engineer
Posts: 10
Joined: 26 Feb 2022 11:57
Skype: Discord: SosMakaroni#2841
Location: Hungary, Budapest

Re: 32bpp 3D Graphics Development Tutorial

Post by SaltMakaroni »

ikarus wrote: 01 Feb 2024 08:25 What I mean though are specs regarding width of the track or height of a tunnel. If the rail is too wide, it will not fit in a bridge. Since it's voxel, it would have to be a percentage of the square.
I don't quite understand what you mean.
A "field" is 32*32 pixels, and in it a basic vehicle (8/8) model is 16 pixels long and 8 pixels wide. You can also see it in the game with Ctrl+B keys.
Image

ikarus wrote: 01 Feb 2024 08:25 I also wonder if it's because of unclear specs that Timberwolf adjusts the height scaling when rendering sprites. Though he admits to creating "oversized" sprites.
You have to play with the height because there are not only 4 directions, but 8. And unfortunately, the horizontal and vertical views are not proportional to the others, they have to be distorted.
This is why I don't like voxeling trains.
An example in the very nice GETS set:
Attachments
A graphic affair due to the length of the train
A graphic affair due to the length of the train
Gets.png (32.34 KiB) Viewed 645 times
Hungarian Voxel World developer
Voxel, drawing, coding hungarian vehicles
Stadler Image Tatra Image Ganz Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google Adsense [Bot] and 20 guests