molstar
Version:
A comprehensive macromolecular library.
20 lines (15 loc) • 575 B
JavaScript
export const hiZ_frag = `
precision highp float;
precision highp sampler2D;
uniform sampler2D tPreviousLevel;
uniform vec2 uInvSize;
uniform vec2 uOffset;
void main(void) {
vec2 position = gl_FragCoord.xy * uInvSize + uOffset;
float x = texture(tPreviousLevel, position).r;
float y = textureOffset(tPreviousLevel, position, ivec2(-1, 0)).r;
float z = textureOffset(tPreviousLevel, position, ivec2(-1, -1)).r;
float w = textureOffset(tPreviousLevel, position, ivec2(0, -1)).r;
gl_FragColor = vec4(max(max(x, y), max(z, w)));
}
`;