Tooltip for Free Look setting.

Postprocessing: Major improvements to nightvision2. Should actually "enhance the game's graphics in a way". Much, much better than the old version.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3951 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Marcus Wanners 2009-08-08 22:01:18 +00:00
parent 69f32a76c6
commit 95b39da7ca
2 changed files with 49 additions and 24 deletions

View File

@ -2,28 +2,50 @@ uniform samplerRECT samp0 : register(s0);
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
//variables
int internalresolution = 1282; //for 800x600; should be changed for other settings.
float4 c0 = texRECT(samp0, uv0).rgba;
float grey = ((0.2 * c0.r) + (0.7 * c0.g) + (0.1 * c0.b))*0.7;
if (grey > 0.7){
;
}
else if (grey > 0.55){
grey = grey*1.5;
}
else if (grey > 0.4){
grey = grey*2;
}
else if (grey > 0.3){
grey = grey*2.5;
}
else if (grey > 0.2){
grey = grey*3;
}
else if (grey > 0.1){
grey = grey*3.5;
}
else{
grey = grey*4;
}
//blur
float4 blurtotal = float4(0, 0, 0, 0);
float blursize = 1.5;
blurtotal += texRECT(samp0, uv0 + float2(-blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( blursize, blursize));
blurtotal += texRECT(samp0, uv0 + float2(-blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( blursize, 0));
blurtotal += texRECT(samp0, uv0 + float2( 0, -blursize));
blurtotal += texRECT(samp0, uv0 + float2( 0, blursize));
blurtotal *= 0.125;
c0 = blurtotal;
//greyscale
float grey = ((0.3 * c0.r) + (0.4 * c0.g) + (0.3 * c0.b));
// brighten
grey = grey * 0.5 + 0.7;
// darken edges
float x = uv0[0];
float y = uv0[1];
if (x > internalresolution/2) x = internalresolution-x;
if (y > internalresolution/2) y = internalresolution-y;
if (x > internalresolution/2*0.95) x = internalresolution/2*0.95;
if (y > internalresolution/2*0.95) y = internalresolution/2*0.95;
x = -x+641;
y = -y+641;
/*****inline square root routines*****/
// bit of a performance bottleneck.
// neccessary to make the darkened area rounded
// instead of rhombus-shaped.
float sqrt=x/10;
while((sqrt*sqrt) < x) sqrt+=0.1;
x = sqrt;
sqrt=y/10;
while((sqrt*sqrt) < y) sqrt+=0.1;
y = sqrt;
/*****end of inline square root routines*****/
x *= 2;
y *= 2;
grey -= x/200;
grey -= y/200;
// output
ocol0 = float4(0, grey, 0, 1.0);
}

View File

@ -415,6 +415,9 @@ void GFXConfigDialogOGL::CreateGUIControls()
#endif
m_DumpFrames->SetValue(g_Config.bDumpFrames);
m_FreeLook = new wxCheckBox(m_PageAdvanced, ID_FREELOOK, wxT("Free Look"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_FreeLook->SetToolTip(
wxT("Use WASD to move around, 0 and 9 to move faster or slower, and the")
wxT(" left mouse button to pan the view."));
m_FreeLook->SetValue(g_Config.bFreeLook);
// Hacks controls