mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: allow ffxCAS sharpness configuration
This commit is contained in:
parent
30e6a258ad
commit
37faccd014
@ -82,6 +82,7 @@ struct EGL_Desktop
|
||||
EGL_Shader * ffxCAS;
|
||||
bool enableCAS;
|
||||
PostProcessHandle ffxCASHandle;
|
||||
EGL_Uniform ffxUniform;
|
||||
};
|
||||
|
||||
// forwards
|
||||
@ -176,6 +177,11 @@ bool egl_desktopInit(EGL * egl, EGL_Desktop ** desktop_, EGLDisplay * display,
|
||||
b_shader_basic_vert , b_shader_basic_vert_size,
|
||||
b_shader_ffx_cas_frag, b_shader_ffx_cas_frag_size);
|
||||
|
||||
desktop->ffxUniform.type = EGL_UNIFORM_TYPE_1F;
|
||||
desktop->ffxUniform.location =
|
||||
egl_shaderGetUniform(desktop->ffxCAS, "uSharpness");
|
||||
desktop->ffxUniform.f[0] = 0.0f;
|
||||
|
||||
setupFilters(desktop);
|
||||
|
||||
return true;
|
||||
@ -263,6 +269,19 @@ void egl_desktopConfigUI(EGL_Desktop * desktop)
|
||||
desktop->enableCAS = cas;
|
||||
egl_textureEnableFilter(desktop->ffxCASHandle, cas);
|
||||
}
|
||||
|
||||
float sharpness = desktop->ffxUniform.f[0];
|
||||
igText("Sharpness:");
|
||||
igSameLine(0.0f, -1.0f);
|
||||
igPushItemWidth(igGetWindowWidth() - igGetCursorPosX() - igGetStyle()->WindowPadding.x);
|
||||
igSliderFloat("##casSharpness", &sharpness, 0.0f, 1.0f, NULL, 0);
|
||||
igPopItemWidth();
|
||||
|
||||
if (sharpness != desktop->ffxUniform.f[0])
|
||||
{
|
||||
desktop->ffxUniform.f[0] = sharpness;
|
||||
egl_shaderSetUniforms(desktop->ffxCAS, &desktop->ffxUniform, 1);
|
||||
}
|
||||
}
|
||||
|
||||
bool egl_desktopSetup(EGL_Desktop * desktop, const LG_RendererFormat format)
|
||||
|
@ -8,6 +8,7 @@ out vec4 fragColor;
|
||||
uniform sampler2D iChannel0;
|
||||
uniform uvec2 uInRes[8];
|
||||
uniform uvec2 uOutRes;
|
||||
uniform float uSharpness;
|
||||
|
||||
// the following are not available until verion 400 or later
|
||||
// so we implement our own versions of them
|
||||
@ -51,12 +52,11 @@ void main()
|
||||
vec4 color;
|
||||
vec2 inputResolution = vec2(uInRes[0]);
|
||||
vec2 outputResolution = vec2(uOutRes);
|
||||
float sharpnessTuning = 1.0f;
|
||||
|
||||
uvec4 const0;
|
||||
uvec4 const1;
|
||||
|
||||
CasSetup(const0, const1, sharpnessTuning,
|
||||
CasSetup(const0, const1, uSharpness,
|
||||
inputResolution.x, inputResolution.y,
|
||||
outputResolution.x, outputResolution.y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user