SHADERSTATICPARM_SHADOWSAMPLER = 10, ///< sampler
SHADERSTATICPARM_CELSHADING = 11, ///< celshading (alternative diffuse and specular math)
SHADERSTATICPARM_CELOUTLINES = 12, ///< celoutline (depth buffer analysis to produce outlines)
- SHADERSTATICPARM_FXAA = 13 ///< fast approximate anti aliasing
+ SHADERSTATICPARM_FXAA = 13, ///< fast approximate anti aliasing
+ SHADERSTATICPARM_COLORFRINGE = 14 ///< colorfringe (chromatic aberration)
};
-#define SHADERSTATICPARMS_COUNT 14
+#define SHADERSTATICPARMS_COUNT 15
static const char *shaderstaticparmstrings_list[SHADERSTATICPARMS_COUNT];
static int shaderstaticparms_count = 0;
R_COMPILESHADER_STATICPARM_ENABLE(SHADERSTATICPARM_CELSHADING);
if (r_celoutlines.integer)
R_COMPILESHADER_STATICPARM_ENABLE(SHADERSTATICPARM_CELOUTLINES);
+ if (r_colorfringe.value)
+ R_COMPILESHADER_STATICPARM_ENABLE(SHADERSTATICPARM_COLORFRINGE);
return memcmp(r_compileshader_staticparms, r_compileshader_staticparms_save, sizeof(r_compileshader_staticparms)) != 0;
}
R_COMPILESHADER_STATICPARM_EMIT(SHADERSTATICPARM_CELSHADING, "USECELSHADING");
R_COMPILESHADER_STATICPARM_EMIT(SHADERSTATICPARM_CELOUTLINES, "USECELOUTLINES");
R_COMPILESHADER_STATICPARM_EMIT(SHADERSTATICPARM_FXAA, "USEFXAA");
+ R_COMPILESHADER_STATICPARM_EMIT(SHADERSTATICPARM_COLORFRINGE, "USECOLORFRINGE");
}
/// information about each possible shader permutation
"\n",
"void main(void)\n",
"{\n",
+"#ifdef USECOLORFRINGE\n",
" float fringe = ColorFringe;//.0033f;\n",
" float amount = distance(TexCoord1, vec2(.5f,.5f));\n",
" vec2 offset = vec2(amount*fringe,amount*fringe);\n",
-" dp_FragColor.xy = texture(Texture_First, TexCoord1-offset).xy;\n",
-" dp_FragColor.z = texture(Texture_First, TexCoord1+offset).z;\n",
+" dp_FragColor.xy = dp_texture2D(Texture_First, TexCoord1-offset).xy;\n",
+" dp_FragColor.z = dp_texture2D(Texture_First, TexCoord1+offset).z;\n",
+"#else\n",
+" dp_FragColor = dp_texture2D(Texture_First, TexCoord1);\n",
+"#endif\n",
"\n",
"#ifdef USEFXAA\n",
" dp_FragColor = fxaa(dp_FragColor, 8.0); // 8.0 can be changed for larger span\n",