mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl: add an HLE brightness/contrast shader for GT series.
It works and it is very fast. But it relies on CRC Others effect need to be tested as well
This commit is contained in:
parent
91c164ecca
commit
70ee8c5bc4
|
@ -673,7 +673,12 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
|
||||||
//
|
//
|
||||||
// First let's check we really have a channel shuffle effect
|
// First let's check we really have a channel shuffle effect
|
||||||
if (m_channel_shuffle) {
|
if (m_channel_shuffle) {
|
||||||
if (m_context->CLAMP.WMS == 3 && ((m_context->CLAMP.MAXU & 0x8) == 8)) {
|
if (m_game.title == CRC::GT4 || m_game.title == CRC::GT3 || m_game.title == CRC::GTConcept) {
|
||||||
|
GL_INS("Gran Turismo RGB Channel");
|
||||||
|
ps_sel.channel = 7;
|
||||||
|
m_context->TEX0.TFX = TFX_DECAL;
|
||||||
|
rt = tex->m_from_target;
|
||||||
|
} else if (m_context->CLAMP.WMS == 3 && ((m_context->CLAMP.MAXU & 0x8) == 8)) {
|
||||||
// Read either blue or Alpha. Let's go for Blue ;)
|
// Read either blue or Alpha. Let's go for Blue ;)
|
||||||
// MGS3/Kill Zone
|
// MGS3/Kill Zone
|
||||||
GL_INS("Blue channel");
|
GL_INS("Blue channel");
|
||||||
|
|
|
@ -331,6 +331,13 @@ vec4 fetch_alpha()
|
||||||
return sample_p(rt.a) * 255.0f;
|
return sample_p(rt.a) * 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec4 fetch_rgb()
|
||||||
|
{
|
||||||
|
vec4 rt = fetch_raw_color();
|
||||||
|
vec4 c = vec4(sample_p(rt.r).r, sample_p(rt.g).g, sample_p(rt.b).b, 1.0f);
|
||||||
|
return c * 255.0f;
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
vec4 sample_color(vec2 st)
|
vec4 sample_color(vec2 st)
|
||||||
|
@ -500,6 +507,8 @@ vec4 ps_color()
|
||||||
vec4 T = fetch_blue();
|
vec4 T = fetch_blue();
|
||||||
#elif PS_CHANNEL_FETCH == 4
|
#elif PS_CHANNEL_FETCH == 4
|
||||||
vec4 T = fetch_alpha();
|
vec4 T = fetch_alpha();
|
||||||
|
#elif PS_CHANNEL_FETCH == 7
|
||||||
|
vec4 T = fetch_rgb();
|
||||||
#elif PS_DEPTH_FMT > 0
|
#elif PS_DEPTH_FMT > 0
|
||||||
// Integral coordinate
|
// Integral coordinate
|
||||||
vec4 T = sample_depth(PSin.t_int.zw);
|
vec4 T = sample_depth(PSin.t_int.zw);
|
||||||
|
|
|
@ -1175,6 +1175,13 @@ static const char* const tfx_fs_all_glsl =
|
||||||
" return sample_p(rt.a) * 255.0f;\n"
|
" return sample_p(rt.a) * 255.0f;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"vec4 fetch_rgb()\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 rt = fetch_raw_color();\n"
|
||||||
|
" vec4 c = vec4(sample_p(rt.r).r, sample_p(rt.g).g, sample_p(rt.b).b, 1.0f);\n"
|
||||||
|
" return c * 255.0f;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
"//////////////////////////////////////////////////////////////////////\n"
|
"//////////////////////////////////////////////////////////////////////\n"
|
||||||
"\n"
|
"\n"
|
||||||
"vec4 sample_color(vec2 st)\n"
|
"vec4 sample_color(vec2 st)\n"
|
||||||
|
@ -1344,6 +1351,8 @@ static const char* const tfx_fs_all_glsl =
|
||||||
" vec4 T = fetch_blue();\n"
|
" vec4 T = fetch_blue();\n"
|
||||||
"#elif PS_CHANNEL_FETCH == 4\n"
|
"#elif PS_CHANNEL_FETCH == 4\n"
|
||||||
" vec4 T = fetch_alpha();\n"
|
" vec4 T = fetch_alpha();\n"
|
||||||
|
"#elif PS_CHANNEL_FETCH == 7\n"
|
||||||
|
" vec4 T = fetch_rgb();\n"
|
||||||
"#elif PS_DEPTH_FMT > 0\n"
|
"#elif PS_DEPTH_FMT > 0\n"
|
||||||
" // Integral coordinate\n"
|
" // Integral coordinate\n"
|
||||||
" vec4 T = sample_depth(PSin.t_int.zw);\n"
|
" vec4 T = sample_depth(PSin.t_int.zw);\n"
|
||||||
|
|
Loading…
Reference in New Issue