Important Dates

Latest Posts

Topic: Ground Textures / Dithering

HendrikL
Avatar
Topic Opener
Joined: 2017-10-09, 13:07
Posts: 16
Ranking
Pry about Widelands
Posted at: 2020-04-17, 12:21

Hey there folks!

Can you enlighten me on, or point me to a resource on how textures and blending/dithering works for the ground?
I am especially interested in the constraints that exist. Here's a rough list:
- Can the ground textures just be replaced by a higher resolution texture?
- Can the tiling repeat over multiple map tiles or is it locked to a single tile?
- Are there special requirements for the texture tiling regarding the hexagonal map tiles?
- Ist the blending mask for tiles just black and white? Does it need to be dithered or is blending possible?
- Would a higher resolution dither texture work?
- Do animated tiles have special constraints?
- I remember the textures being indexed PNGs. So is everything limited to 256 colors at the moment?


Is there something else that needs to be thought of? Are there any blender scripts it needs to be compatible with?

Thank you for your time and dedication!
Kind Regards
Hendrik

Edited: 2020-04-17, 12:22

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2029
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-04-17, 12:45

Moin!

The texture resolution of 64×64 pixels is currently hardcoded, we have an open wishlist issue about allowing up to 256×256 and implementing scaling.

For more details on terrain defining and how the square textures are applied to the triangles, see
https://www.widelands.org/wiki/HelpTerrains/
https://www.widelands.org/documentation/autogen_terrains_lua_world_units_init/

The terrain textures on a given triangle will be made brighter or darker depending on the triangle's 3D orientation.
Textures are indexed PNGs, so yes the colours are limited unfortunately.
I don't know the details on how the dithering is implemented, but AFAIK this is done just by randomly setting some pixels near an edge to a pixel value taken from the neighbouring terrain's texture. Nothing the artist can do about that.
I am fairly sure (not 100% certain though) there are no blender scripts related to textures at all.

Hope this helps you face-smile.png


Top Quote
HendrikL
Avatar
Topic Opener
Joined: 2017-10-09, 13:07
Posts: 16
Ranking
Pry about Widelands
Posted at: 2020-04-17, 18:17

That's all I need to know for now!

Thanks Nordfriese!


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2514
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-04-17, 22:37

Nordfriese wrote:

I don't know the details on how the dithering is implemented, but AFAIK this is done just by randomly setting some pixels near an edge to a pixel value taken from the neighbouring terrain's texture.

It's done vie the file data/world/pics/edge.png face-smile.png


Top Quote