Merge pull request #79865 from clayjohn/discard-shader
Fix use of discard in shaders
This commit is contained in:
commit
3f2e901633
6 changed files with 27 additions and 17 deletions
|
|
@ -1039,17 +1039,16 @@ void main() {
|
|||
if (alpha < alpha_scissor_threshold) {
|
||||
discard;
|
||||
}
|
||||
#endif // ALPHA_SCISSOR_USED
|
||||
|
||||
#else
|
||||
#ifdef MODE_RENDER_DEPTH
|
||||
#ifdef USE_OPAQUE_PREPASS
|
||||
#if !defined(ALPHA_SCISSOR_USED)
|
||||
|
||||
if (alpha < opaque_prepass_threshold) {
|
||||
discard;
|
||||
}
|
||||
|
||||
#endif // not ALPHA_SCISSOR_USED
|
||||
#endif // USE_OPAQUE_PREPASS
|
||||
#endif // MODE_RENDER_DEPTH
|
||||
#endif // !ALPHA_SCISSOR_USED
|
||||
|
||||
#endif // !USE_SHADOW_TO_OPACITY
|
||||
|
||||
|
|
@ -1270,17 +1269,16 @@ void main() {
|
|||
if (alpha < alpha_scissor) {
|
||||
discard;
|
||||
}
|
||||
#endif // ALPHA_SCISSOR_USED
|
||||
|
||||
#else
|
||||
#ifdef MODE_RENDER_DEPTH
|
||||
#ifdef USE_OPAQUE_PREPASS
|
||||
#if !defined(ALPHA_SCISSOR_USED)
|
||||
|
||||
if (alpha < opaque_prepass_threshold) {
|
||||
discard;
|
||||
}
|
||||
|
||||
#endif // not ALPHA_SCISSOR_USED
|
||||
#endif // USE_OPAQUE_PREPASS
|
||||
#endif // MODE_RENDER_DEPTH
|
||||
#endif // !ALPHA_SCISSOR_USED
|
||||
|
||||
#endif // USE_SHADOW_TO_OPACITY
|
||||
|
||||
|
|
|
|||
|
|
@ -1338,7 +1338,7 @@ MaterialStorage::MaterialStorage() {
|
|||
actions.render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
|
||||
actions.render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
|
||||
actions.render_mode_defines["particle_trails"] = "#define USE_PARTICLE_TRAILS\n";
|
||||
actions.render_mode_defines["depth_draw_opaque"] = "#define USE_OPAQUE_PREPASS\n";
|
||||
actions.render_mode_defines["depth_prepass_alpha"] = "#define USE_OPAQUE_PREPASS\n";
|
||||
|
||||
bool force_lambert = GLOBAL_GET("rendering/shading/overrides/force_lambert_over_burley");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue