Daemon
Daemon copied to clipboard
Rename some symbols consistently with other parts of the code + add some missing switch case
Some things I noticed while reading the code while trying to fix #677 (those patches don't fix it).
renderer: name SPECULAR and PHYSICAL consistently with the rest of the code
This patch does not change anything to the logic.
-
rename PHONG and PBR as SPECULAR and PHYSICAL to be consistent with the rest of the code. The PHONG and PBR names were just names I used in my very first commits when rewriting the material collapse code refactoring the GLSL code, before I had enough knowledge to decide to name the variant specular and physical. Now that they are named specular and physical everywhere else, it's better to unify back those early occurrences.
-
I also reordered tests for specular before physical because:
- specular code is the default if there is no specular or physical map (a black specular map is used) or if both specular mapping and physical mapping are disabled. Physical mapping can also be used with a black physical map when there is no specular or physical map but the specular code is faster that's why it's the default.
- there is no game running on Dæmon using PBR textures yet.
Some reordering are just bikeshedding to just make the things consistent. Specular code is the default anyway.
renderer: add some missing cases for PHYSICAL in some switches
This one may fix some bugs in PBR code. PHYSICAL and SPECULAR variants are just expected to be usable anywhere where the other is usable, they just compute light effects differently with a different texture. It would even be possible to only use a single type for both and add an extra boolean for the variant but using two types just makes the code simpler everywhere.
renderer: simplify a switch case
Two switch cases were just doing the same things.