• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Zed68

General
6 Badges
Aug 26, 2014
1.857
885
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Parklife
Hi Cimtizens!


If you've tried to use alpha maps for your buildings you might have noticed one or two things that you couldn't do with them, or that didn't work.


First : alphas are on or off.

You can make an alpha map with different shades of grey (fifty... or even more...) but in the game everything under 50% black is transparent, everything over it is visible.


Second one : alphas act weird for making balconies railings or grilles... let me show you.


I've built a simple 2m side cube, each side mapped with a simple grille texture. Let's see how it looks like ingame :

769606AlphaBalcons01.jpg


Not bad... would look good as a balcony... but what happens when we zoom out?


588607AlphaBalcons02.jpg


Damnit!! What's going on here ???

Well as we know there are no half transparencies in the game. As we zoom out the engine averages pixels in the alpha map and the result? When a pixel goes under 50% white alpha it disappears from view.

But this and the fact that everything from 50 to 100 is invisible made me think... if we don't use black but dark grey for the transparent parts... the averaging will make the grid visible longer.


So here we go, experiment N°2

We will have four different cubes

We will use 3 different alpha maps : one with 100% black, one with 75% and the last one with 52%

696386AlphaBalcons03.png
533675AlphaBalcons03b.png
536464AlphaBalcons04.png



The fourth experiment will use the 52% black alpha, but will use a different diffuse map.

The 3 first have a full white diffuse, but the fourth will use a diffuse with black outside of the visible parts, but the white parts will be bigger because the black color will bleed onto the grille.

728253AlphaBalcons05.png




And now for the results :


Close-up :

738153AlphaBalcons06.jpg


Everything's fine but we already notice the grille looks more defined when the black parts of the alpha are not pure black



Zooming out :

415935AlphaBalcons07.jpg


100% black is already dead... 75% starts to look thinner, 52% starts to become solid... 52% plus black outlines looks good



Zoooooming out again :

615649AlphaBalcons08.jpg


100% black still dead, 75% looks like a videogame from the 80's, 52% well... looks better... 52% plus black still holding on.


The last one :

207761AlphaBalcons09.jpg



100% and 75% dead. 52% has gone pure solid. 52 plus black outlines is just showing the diffuse too but at that distance it looks pretty ok.


Conclusion : If you want to make a grille (for an opening or a balcony or a fence maybe) do not use 100% black for the solid color. Use 52 (or maybe 51, I tested with 52 because... because) and put an outline of the grille in the diffuse color.


For more opened grilles you might want to use a different amount of black (because if the grille goes invisible it will be less noticable and you actually want to make it happen later but you don't want it to become solid.).




Thanks for reading, have fun building.

Cool_Z - Zed68
 
  • 4
  • 1
Reactions:
1) Can the alpha treatment be modded from the bitwise harsh into something more gentle? Would have a performance hit I bet.

2) Can LOD be used to make it look good on other distances with different alpha maps for each LOD?
 
Zed68, This just might work for my tree that I've made because it uses all kinda of tiny flowers spaced apart... I really hope you found a fix for my problem, I'm gonna try this later and report back.