Preparation for OpenGL ES

This commit is contained in:
2024-08-20 17:53:30 +02:00
parent 7ed38cf6d7
commit dd16a02045
10 changed files with 61 additions and 41 deletions
+3 -5
View File
@@ -1,5 +1,3 @@
#version 330
uniform sampler2D qt_Texture0;
uniform vec3 mtf_param[3];
uniform vec2 unit_scale;
@@ -22,7 +20,7 @@ vec4 MTF(vec4 x, vec4 low, vec4 mid, vec4 high)
{
x = (x - low) / (high - low);
x = clamp(x, vec4(0.0), vec4(1.0));
return ((mid - 1) * x) / ((2 * mid - 1) * x - mid);
return ((mid - 1.0) * x) / ((2.0 * mid - 1.0) * x - mid);
}
vec3 falsecolor(float color)
@@ -59,7 +57,7 @@ vec4 cubic(float v)
vec4 textureBicubic(sampler2D sampler, vec2 texCoords)
{
vec2 texSize = textureSize(sampler, 0);
vec2 texSize = vec2(textureSize(sampler, 0));
vec2 invTexSize = 1.0 / texSize;
texCoords = texCoords * texSize - 0.5;
@@ -133,7 +131,7 @@ void main(void)
switch(filtering)
{
case 0://nearest
color = texelFetch(qt_Texture0, ivec2(qt_TexCoord0 * textureSize(qt_Texture0, 0)), 0);
color = texelFetch(qt_Texture0, ivec2(qt_TexCoord0 * vec2(textureSize(qt_Texture0, 0))), 0);
break;
default:
case 1://bilinear