Compare images in fitness function and benchmark them
This commit is contained in:
parent
0183d4737c
commit
d38e45dac8
7 changed files with 189 additions and 11 deletions
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
// try isampler2D, ivec4 etc.? Probably not
|
||||
uniform vec2 size;
|
||||
uniform vec2 offs;
|
||||
// uniform vec2 offs;
|
||||
uniform sampler2D base;
|
||||
uniform sampler2D curr;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 pos = (gl_FragCoord.xy-offs)/size;
|
||||
pos.y = 1.0 - pos.y;
|
||||
vec2 pos = gl_FragCoord.xy/size;
|
||||
vec4 color = texture2D(curr, pos);
|
||||
pos.y = 1.0 - pos.y;
|
||||
vec4 basecolor = texture2D(base, pos);
|
||||
color.xyz = abs(color.xyz - basecolor.xyz);
|
||||
color.rgb = abs(color.rgb - basecolor.rgb);
|
||||
gl_FragColor = color;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue