Overlay for Company color [Blender]

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
Gramble
Engineer
Engineer
Posts: 45
Joined: 09 Sep 2007 17:35
Location: near Cologne

Overlay for Company color [Blender]

Post by Gramble »

How can I create overlays for my vehicles I've made in blender. The information in the Sticky topic don't suffice for me, and I'm not able to find any tutorials on this topic.

MfG Thomas
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Overlay for Company color [Blender]

Post by GeekToo »

Company colours can be applied to 32 bpp: create a file aaaam.png, where aaaa is the sprite number. The png has to be 8bpp colour indexed. It is used as a mask. Draw the company colours with colour index 196-203 ( The blueish colour on the original OTTD palette)

For an example: download my foster bus, it's mentioned on the 32bpp download list on the wiki
User avatar
Wacki
Traffic Manager
Traffic Manager
Posts: 137
Joined: 28 Feb 2007 09:02
Location: Czech Republic
Contact:

Re: Overlay for Company color [Blender]

Post by Wacki »

And someday will be 32bpp layer???
Sorry for my very bad English!!! :(
I am 3dsmax artist.
LordAzamath
Tycoon
Tycoon
Posts: 1656
Joined: 08 Jun 2007 08:00

Re: Overlay for Company color [Blender]

Post by LordAzamath »

Wacki wrote:And someday will be 32bpp layer???
mm.. no I think... Dalestan (I think) made a quick calculation once somewhere which showed that the source size would be 64Mb bigger, if 32bpp palette was added... Or something like that.. Not sure though
PS: And I stopped the propaganda to support Dave Worley since he got a nice new red hat now.[/color]
I know I have a BBCode error in my signature but I really cba to fix it.
User avatar
Wacki
Traffic Manager
Traffic Manager
Posts: 137
Joined: 28 Feb 2007 09:02
Location: Czech Republic
Contact:

Re: Overlay for Company color [Blender]

Post by Wacki »

And it is possible add ONLY 32bpp blue palette, which should be use as company colour layer???

EDIT: or use for this 16bpp palette???
Sorry for my very bad English!!! :(
I am 3dsmax artist.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Overlay for Company color [Blender]

Post by DaleStan »

Palette and "32bpp" are mutually exclusive; the point of a palette is to map a few small numbers (like maybe 256 8-bit numbers, or 16 4-bit numbers) onto an equal count of the much larger 24-bit numbers that most OSen store in their video memories.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Overlay for Company color [Blender]

Post by GeekToo »

For 32bpp you don't need a palette, that's a typical 8bpp concept. As Lord Azamath said, for 32bpp it would contain something like 16.7 million colours.
Problem in the current 32bpp trunk is that sprite colours are completely replaced by the 8bpp colours in the mask. For the company colours that means only 8 shades of every player colour are available. This is visible next to the 32 bpp colours ( = ugly ).

A much better way would be, I think, to use the 8bpp mask as defined now, and draw the areas in the 32bpp sprites where the company colours must be applied as 32bpp greyscale.
The code can then blend the company colours as defined by the mask( lookup in the 8bpp palette) with the greyscale from the sprite, producing much more colours. This means a change in the code, but I was already thinking about making that change anyway. So I plan to implement this on one of the next revisions of my extra zoom patch.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Overlay for Company color [Blender]

Post by Zephyris »

Or just 8bpp greyscale for <spriteno>m.png, then use the alpha channel from the 32bpp <spriteno>.png. White or black in <spriteno>m.png could be used as the transparent colour (as these would never be "company colourised").
Gramble
Engineer
Engineer
Posts: 45
Joined: 09 Sep 2007 17:35
Location: near Cologne

Re: Overlay for Company color [Blender]

Post by Gramble »

Please comment on my first try:
sample_SC72_basic.png
sample_SC72_basic.png (12.02 KiB) Viewed 4914 times
+
sample_SC72_overlay.png
sample_SC72_overlay.png (2.17 KiB) Viewed 4912 times
=
sample_SC72_overlayed.png
sample_SC72_overlayed.png (11.21 KiB) Viewed 4918 times
Any ideas what I could do better. I think the company colors are not colorful enough, but if I put the overlay's Alpha up, the material of the basic image is gone.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Overlay for Company color [Blender]

Post by GeekToo »

Zephyris wrote:Or just 8bpp greyscale for <spriteno>m.png, then use the alpha channel from the 32bpp <spriteno>.png. White or black in <spriteno>m.png could be used as the transparent colour (as these would never be "company colourised").
That was about the idea I started with, but I'm afraid it won't work: The code does not use the palette of the mask, only the pixels. The value of the 8bpp pixels in the mask is actually an index to the palette. This palette is hardcoded in the game, or supplied by a newgrf.

What do I mean by an index in the palette: for every sprite the code defines 256 colours, numbered from 0 to 255(the palette). These colours can change according to colour variation or player colour ( so multiple palettes exist ). A pixel in the mask file just points to one of the colours in the palette defined for that sprite. So depending on the player colour or colour variation, the same mask can result in different colours on the screen. The palette of the mask file is completely ignored.

This means that company colours will always have to be defined in the range 196-203, and depending on the player colour (in the palette), this will show a certain colour.

That's why you can't define a greyscale in the mask, but I think it must be done in the 32 bpp sprite. On 32bpp we don't need a transparency colour, the alfa channel is used for that, so that can't be used for anything else.

@ Gramble: nice work, this illustrates the idea I was thinking of very well. Same remark to you: the actual colour cannot be retrieved from the mask, so the company colours must be in the blueish 196-203 pixel index.

I don't know what graphics program you used to overlay the sprite, but the exact method will need some experimenting: on photoshop or gimp, there are multiple blend modes, we will have to find out what works best.
Gramble
Engineer
Engineer
Posts: 45
Joined: 09 Sep 2007 17:35
Location: near Cologne

Re: Overlay for Company color [Blender]

Post by Gramble »

I've used GIMP. I copied the blend file and changed the materials to materials without any effects (without shadows etc.). I've only changed the alpha of the material. In Gimp I have just added a new layer to the orginal image with the overlay.
So, I used Gimp just to put these files together.

My only question: Is there any way to create an overlay that does not cover the basic image (shadows etc.) like you can see in the sticky?
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Re: Overlay for Company color [Blender]

Post by GeekToo »

Gramble wrote:I've used GIMP. I copied the blend file and changed the materials to materials without any effects (without shadows etc.). I've only changed the alpha of the material. In Gimp I have just added a new layer to the orginal image with the overlay.
So, I used Gimp just to put these files together.
I did experiment a little in the Gimp: try the following: make the overlay layer alfa app. 70 %. Set the blending mode of the overlay to multiply and not normal: Ctrl-L, mode field. That way the color will be more visible I think. But this will need more experiments to get the best results.
Gramble wrote: My only question: Is there any way to create an overlay that does not cover the basic image (shadows etc.) like you can see in the sticky?
The methods for Company Colour described in the sticky were plans for the 32bpp branch, and never implemented as far as I know. But as said before, I will try to implement it in the extra zoom patch.
Attachments
sample_SC72_basic2.png
sample_SC72_basic2.png (11.69 KiB) Viewed 4619 times
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 10 guests