FAForever / FAForever/fa

Terrain shader naming scheme

Open
#5,529 1 comment 0 reactions 0 assignees View on GitHub
area: code style
Dominant language
Lua
Stars
264
Forks
260
Avg merge
3d 2h
Merged PRs (30d)
21

Description

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
- Terrain0XX for shaders that are pretty regular
- Terrain1XX for shaders using roughness maps
- Terrain2XX for shaders using advanced splatting
- Terrain3XX for shaders using roughness and advanced splatting

The second digit gives info about some technical properties of the shader with the range being divided into two halfes:
- TerrainX0X to TerrainX4X for shaders with half mask range
- TerrainX5X to TerrainX9X for shaders using the full mask range

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:
- TerrainX1X and TerrainX6X for shaders using biplanar mapping?
- TerrainX2X and TerrainX7X for shaders using additional rotated sampling? (This is for breaking up the texture repetition)
- TerrainX3X and TerrainX8X for shaders using biplanar mapping and additional rotated sampling?

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.