mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 13:07:54 +00:00
[client] egl: make nightvision enhance luminosity before gain
This commit is contained in:
parent
d6805cfa0f
commit
1fbba5cf2d
4 changed files with 14 additions and 3 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
a12-134-g4dee965fdf+1
|
||||
a12-135-gd6805cfa0f+1
|
|
@ -131,7 +131,9 @@ void egl_desktop_toggle_nv(SDL_Scancode key, void * opaque)
|
|||
if (++desktop->nvGain == 4)
|
||||
desktop->nvGain = 0;
|
||||
|
||||
app_alert(LG_ALERT_INFO, "Screen Gain +%d", desktop->nvGain);
|
||||
if (desktop->nvGain == 0) app_alert(LG_ALERT_INFO, "NV Disabled");
|
||||
else if (desktop->nvGain == 1) app_alert(LG_ALERT_INFO, "NV Enabled");
|
||||
else app_alert(LG_ALERT_INFO, "NV Gain + %d", desktop->nvGain - 1);
|
||||
}
|
||||
|
||||
void egl_desktop_free(EGL_Desktop ** desktop)
|
||||
|
@ -240,7 +242,7 @@ void egl_desktop_render(EGL_Desktop * desktop, const float x, const float y, con
|
|||
if (desktop->nvGain)
|
||||
{
|
||||
glUniform1i(desktop->uNV, 1);
|
||||
glUniform1f(desktop->uNVGain, (float)(desktop->nvGain+1));
|
||||
glUniform1f(desktop->uNVGain, (float)desktop->nvGain);
|
||||
}
|
||||
else
|
||||
glUniform1i(desktop->uNV, 0);
|
||||
|
|
|
@ -10,6 +10,11 @@ uniform highp float nvGain;
|
|||
void main()
|
||||
{
|
||||
color = texture(sampler1, uv);
|
||||
|
||||
if (nv == 1)
|
||||
{
|
||||
highp float lumi = 1.0 - (0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b);
|
||||
color *= 1.0 + lumi;
|
||||
color *= nvGain;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,5 +28,9 @@ void main()
|
|||
|
||||
color = yuv * yuv_to_rgb;
|
||||
if (nv == 1)
|
||||
{
|
||||
highp float lumi = 1.0 - (0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b);
|
||||
color *= 1.0 + lumi;
|
||||
color *= nvGain;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue