From: divverent Date: Tue, 29 Jan 2008 12:29:14 +0000 (+0000) Subject: add an extra unused #ifdef to the glsl shader so the shader can know if it was actual... X-Git-Tag: xonotic-v0.1.0preview~2471 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1017a158e4943390fc79c6dbd9db0b3a3a9487b3;p=xonotic%2Fdarkplaces.git add an extra unused #ifdef to the glsl shader so the shader can know if it was actually enabled by r_glsl_postprocessing or if it was just forced by bloom git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8043 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 6e107095..7ad76f49 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -528,6 +528,10 @@ static const char *builtinshaderstring = " gl_FragColor = mix(TintColor, gl_FragColor, TintColor.a);\n" "#endif\n" "\n" +"#ifdef USEPOSTPROCESSING\n" +"// add your own postprocessing here or make your own ifdef for it\n" +"#endif\n" +"\n" "}\n" "# endif\n" "\n" @@ -1087,8 +1091,9 @@ typedef enum shaderpermutation_e SHADERPERMUTATION_OFFSETMAPPING = 1<<9, // adjust texcoords to roughly simulate a displacement mapped surface SHADERPERMUTATION_OFFSETMAPPING_RELIEFMAPPING = 1<<10, // adjust texcoords to accurately simulate a displacement mapped surface (requires OFFSETMAPPING to also be set!) SHADERPERMUTATION_GAMMA = 1<<11, // gamma (postprocessing only) - SHADERPERMUTATION_LIMIT = 1<<12, // size of permutations array - SHADERPERMUTATION_COUNT = 12 // size of shaderpermutationinfo array + SHADERPERMUTATION_POSTPROCESSING = 1<<12, // gamma (postprocessing only) + SHADERPERMUTATION_LIMIT = 1<<13, // size of permutations array + SHADERPERMUTATION_COUNT = 13 // size of shaderpermutationinfo array } shaderpermutation_t; @@ -1107,6 +1112,7 @@ shaderpermutationinfo_t shaderpermutationinfo[SHADERPERMUTATION_COUNT] = {"#define USEOFFSETMAPPING\n", " offsetmapping"}, {"#define USEOFFSETMAPPING_RELIEFMAPPING\n", " reliefmapping"}, {"#define USEGAMMA\n", " gamma"}, + {"#define USEPOSTPROCESSING\n", " postprocessing"}, }; // this enum is multiplied by SHADERPERMUTATION_MODEBASE @@ -3374,8 +3380,8 @@ static void R_BlendView(void) (r_bloomstate.texture_bloom ? SHADERPERMUTATION_GLOW : 0) | (r_refdef.viewblend[3] > 0 ? SHADERPERMUTATION_VERTEXTEXTUREBLEND : 0); if(r_glsl_postprocess.value) - permutation |= - (r_glsl_postprocess_contrastboost.value != 1 ? SHADERPERMUTATION_CONTRASTBOOST : 0) + permutation |= SHADERPERMUTATION_POSTPROCESSING + | (r_glsl_postprocess_contrastboost.value != 1 ? SHADERPERMUTATION_CONTRASTBOOST : 0) | (r_glsl_postprocess_gamma.value != 1 ? SHADERPERMUTATION_GAMMA : 0); if (r_bloomstate.texture_bloom && !r_bloomstate.hdr)