FAForever / fa

Lua code for FAF
228 stars 233 forks source link

Terrain shader naming scheme #5529

Open BlackYps opened 1 year ago

BlackYps commented 1 year ago

This issue is to discuss naming conventions for new map shaders. There is a load of different features that we can make available to mappers, but they might not want to use all of these at once. For example some things require more work than others if you want to transfer an existing map to a new shader. We started out with a numeric scheme which sounds reasonable as we need all the names to be the same length to make switching them easier. We can extend the naming scheme as follows. Note that not all permutations are necessarily available or even planned, but I think having some naming rules makes it easier to later select a specific shader than just incrementing the number every time we create a new terrain shader.

We have three digits to work with, the first digit shows the main category

The second digit gives info about some technical properties of the shader with the range being divided into two halfes:

For this we can implement a boolean toggle in the shader to avoid code duplication.

We can then use individual digits for different properties, for example:

This leaves us with the third digit to have enough room to create multiple shader variations of the same category if needed. For example we could variate in which layer the biplanar mapping is applied or on how many layers.

In this setup TerrainX3X and TerrainX8X are still unused and could be used for a category that I haven't thought of yet

Garanas commented 1 year ago

I've got nothing to add; this seems like a great suggestion to me.