flicker test
This commit is contained in:
parent
9b86d84eaf
commit
7899b08f3b
|
@ -279,8 +279,11 @@ int main(int argc, char** argv)
|
|||
auto t1 = Time::now();
|
||||
auto startTime = Time::now();
|
||||
int32_t stops = 0;
|
||||
uint32_t frameCounter = 0;
|
||||
while (r_window->Update(handler))
|
||||
{
|
||||
frameCounter++;
|
||||
|
||||
const auto t2 = Time::now();
|
||||
auto delta = t2 - t1;
|
||||
const float dt = Seconds(delta).count();
|
||||
|
@ -334,7 +337,7 @@ int main(int argc, char** argv)
|
|||
|
||||
PushConstants pushConstants =
|
||||
{
|
||||
.frameIdx = r_swapchain->CurrentFrame(),
|
||||
.frameIdx = frameCounter,//r_swapchain->CurrentFrame(),
|
||||
.currentTestIdx = currentTest,
|
||||
.time = time,
|
||||
.targetNits = targetNits,
|
||||
|
|
|
@ -98,6 +98,15 @@ void main()
|
|||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
const vec3 start = vec3(0.0);
|
||||
const vec3 end = vec3(nitsToPq(vec3(targetNits)).x);
|
||||
|
||||
vec3 color = mix(start, end, coords.x);
|
||||
|
||||
outColor = vec4(color, 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
const vec3 start = vec3(0.0);
|
||||
const vec3 end = vec3(targetNits);
|
||||
|
@ -115,16 +124,7 @@ void main()
|
|||
else if (test == nextTest++)
|
||||
{
|
||||
const vec3 start = vec3(0.0);
|
||||
const vec3 end = vec3(hsv_to_rgb(vec3(coords.y, 1.0, 1.0)) * targetNits);
|
||||
|
||||
vec3 color = mix(start, end, coords.x);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
const vec3 start = vec3(0.0);
|
||||
const vec3 end = vec3(targetNits);
|
||||
const vec3 end = vec3(nitsToPq(vec3(targetNits)).x);
|
||||
|
||||
vec3 color = mix(start, end, coords.x);
|
||||
if (coords.y < 1.0 / 3.0)
|
||||
|
@ -134,6 +134,157 @@ void main()
|
|||
else
|
||||
color.rg = vec2(0.0);
|
||||
|
||||
outColor = vec4(color, 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
if (coords.x < 1.0 / 7.0)
|
||||
color.rgb = vec3(1.0);
|
||||
else if (coords.x < 2.0 / 7.0)
|
||||
color.rg = vec2(1.0);
|
||||
else if (coords.x < 3.0 / 7.0)
|
||||
color.gb = vec2(1.0);
|
||||
else if (coords.x < 4.0 / 7.0)
|
||||
color.g = 1.0;
|
||||
else if (coords.x < 5.0 / 7.0)
|
||||
color.rb = vec2(1.0);
|
||||
else if (coords.x < 6.0 / 7.0)
|
||||
color.r = 1.0;
|
||||
else
|
||||
color.b = 1.0;
|
||||
|
||||
color *= targetNits;
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
if (coords.x < 1.0 / 7.0)
|
||||
color.rgb = vec3(1.0);
|
||||
else if (coords.x < 2.0 / 7.0)
|
||||
color.rg = vec2(1.0);
|
||||
else if (coords.x < 3.0 / 7.0)
|
||||
color.gb = vec2(1.0);
|
||||
else if (coords.x < 4.0 / 7.0)
|
||||
color.g = 1.0;
|
||||
else if (coords.x < 5.0 / 7.0)
|
||||
color.rb = vec2(1.0);
|
||||
else if (coords.x < 6.0 / 7.0)
|
||||
color.r = 1.0;
|
||||
else
|
||||
color.b = 1.0;
|
||||
|
||||
color = max(color, vec3(0.5));
|
||||
color *= targetNits;
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
if (coords.y < 1.0 / 7.0)
|
||||
color.rgb = vec3(1.0);
|
||||
else if (coords.y < 2.0 / 7.0)
|
||||
color.rg = vec2(1.0);
|
||||
else if (coords.y < 3.0 / 7.0)
|
||||
color.gb = vec2(1.0);
|
||||
else if (coords.y < 4.0 / 7.0)
|
||||
color.g = 1.0;
|
||||
else if (coords.y < 5.0 / 7.0)
|
||||
color.rb = vec2(1.0);
|
||||
else if (coords.y < 6.0 / 7.0)
|
||||
color.r = 1.0;
|
||||
else
|
||||
color.b = 1.0;
|
||||
|
||||
color *= coords.x;
|
||||
|
||||
color *= targetNits;
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
float val = nitsToPq(vec3(targetNits)).x;
|
||||
|
||||
if (coords.y < 1.0 / 7.0)
|
||||
color.rgb = vec3(val);
|
||||
else if (coords.y < 2.0 / 7.0)
|
||||
color.rg = vec2(val);
|
||||
else if (coords.y < 3.0 / 7.0)
|
||||
color.gb = vec2(val);
|
||||
else if (coords.y < 4.0 / 7.0)
|
||||
color.g = val;
|
||||
else if (coords.y < 5.0 / 7.0)
|
||||
color.rb = vec2(val);
|
||||
else if (coords.y < 6.0 / 7.0)
|
||||
color.r = val;
|
||||
else
|
||||
color.b = val;
|
||||
|
||||
color *= coords.x;
|
||||
|
||||
outColor = vec4(color, 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
if (coords.y < 1.0 / 7.0)
|
||||
color.rgb = vec3(1.0);
|
||||
else if (coords.y < 2.0 / 7.0)
|
||||
color.rg = vec2(1.0);
|
||||
else if (coords.y < 3.0 / 7.0)
|
||||
color.gb = vec2(1.0);
|
||||
else if (coords.y < 4.0 / 7.0)
|
||||
color.g = 1.0;
|
||||
else if (coords.y < 5.0 / 7.0)
|
||||
color.rb = vec2(1.0);
|
||||
else if (coords.y < 6.0 / 7.0)
|
||||
color.r = 1.0;
|
||||
else
|
||||
color.b = 1.0;
|
||||
|
||||
color *= floor(coords.x * 21.0) / 21.0;
|
||||
|
||||
color *= targetNits;
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
float val = nitsToPq(vec3(targetNits)).x;
|
||||
|
||||
if (coords.y < 1.0 / 7.0)
|
||||
color.rgb = vec3(val);
|
||||
else if (coords.y < 2.0 / 7.0)
|
||||
color.rg = vec2(val);
|
||||
else if (coords.y < 3.0 / 7.0)
|
||||
color.gb = vec2(val);
|
||||
else if (coords.y < 4.0 / 7.0)
|
||||
color.g = val;
|
||||
else if (coords.y < 5.0 / 7.0)
|
||||
color.rb = vec2(val);
|
||||
else if (coords.y < 6.0 / 7.0)
|
||||
color.r = val;
|
||||
else
|
||||
color.b = val;
|
||||
|
||||
color *= floor(coords.x * 21.0) / 21.0;
|
||||
|
||||
outColor = vec4(color, 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
const vec3 color = vec3(hsv_to_rgb(vec3(1.0 - coords.y, coords.x, 1.0)) * targetNits);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
|
@ -155,7 +306,7 @@ void main()
|
|||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
if ((int(gl_FragCoord.x) & 1) == 0 && (int(gl_FragCoord.y) & 1) == 0)
|
||||
if (((int(gl_FragCoord.x) & 1) == 0) == ((int(gl_FragCoord.y) & 1) == 0))
|
||||
color = vec3(targetNits);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
|
@ -191,6 +342,16 @@ void main()
|
|||
outColor = vec4(nitsToPq(vec3(0, 0, value)), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
float value = ((frame & 1) == 0) ? targetNits : 0.0;
|
||||
|
||||
uint index = (frame >> 1u) % 3u;
|
||||
vec3 color = vec3(0);
|
||||
color[index] = value;
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
const float seed = fract(time);
|
||||
|
||||
|
@ -209,4 +370,36 @@ void main()
|
|||
|
||||
outColor = vec4(nitsToPq(value), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
if (((int(gl_FragCoord.x / 32.0) & 1) == 0) == ((int(gl_FragCoord.y / 32.0) & 1) == 0))
|
||||
color = vec3(targetNits);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
if (((int(gl_FragCoord.x / 32.0) & 1) == 0) == ((int(gl_FragCoord.y / 32.0) & 1) == 0))
|
||||
color = vec3(targetNits, 0, 0);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
if (((int(gl_FragCoord.x / 32.0) & 1) == 0) == ((int(gl_FragCoord.y / 32.0) & 1) == 0))
|
||||
color = vec3(0, targetNits, 0);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
else if (test == nextTest++)
|
||||
{
|
||||
vec3 color = vec3(0.0);
|
||||
if (((int(gl_FragCoord.x / 32.0) & 1) == 0) == ((int(gl_FragCoord.y / 32.0) & 1) == 0))
|
||||
color = vec3(0, 0, targetNits);
|
||||
|
||||
outColor = vec4(nitsToPq(color), 1.0);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue