Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Cleanup shader generation code (#10663)
Shader generation is a mess. This commit cleans some parts up, including dropping remains of HLSL support which was never actually implemented.
- Loading branch information
1 parent
664f5ce
commit ccbf802
Showing
11 changed files
with
164 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ varying vec3 eyeVec; | |
const float fogStart = FOG_START; | ||
const float fogShadingParameter = 1.0 / ( 1.0 - fogStart); | ||
|
||
#ifdef ENABLE_TONE_MAPPING | ||
#if ENABLE_TONE_MAPPING | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sfan5
Member
|
||
|
||
/* Hable's UC2 Tone mapping parameters | ||
A = 0.22; | ||
|
@@ -73,7 +73,7 @@ void main(void) | |
|
||
vec4 col = vec4(color.rgb * varColor.rgb, 1.0); | ||
|
||
#ifdef ENABLE_TONE_MAPPING | ||
#if ENABLE_TONE_MAPPING | ||
col = applyToneMapping(col); | ||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
I think this change is not good.
The reason for this is that it's common for such flags to be left undefined, leading to the #if statement having an undefined behaviour. Most sane compilers will give undefined macros a value of '0' during such #if comparisons, but some compilers throw errors. So, to play it safe, use #ifdef.
For further reading, refer to the coding convention document of DCSS.