0 true #version 150 //OVE shader_name: posterize //OVE shader_description: ported from Olive 0.1 filters. //OVE main_input_name: Input uniform sampler2D tex_in; //OVE name: Gamma //OVE type: FLOAT //OVE flag: NOT_CONNECTABLE //OVE min: 0 //OVE default: 60 //OVE description: uniform float gamma_cent; //OVE name: Colors //OVE type: FLOAT //OVE flag: NOT_CONNECTABLE //OVE min: 0 //OVE default: 8 //OVE description: uniform float numColors; //OVE end // pixel coordinates in range [0..1]x[0..1] in vec2 ove_texcoord; // output color out vec4 frag_color; void main() { float gamma = gamma_cent*0.01; vec4 color = texture(tex_in, ove_texcoord); vec3 c = color.rgb; c = pow(c, vec3(gamma, gamma, gamma)); c = c * numColors; c = floor(c); c = c / numColors; c = pow(c, vec3(1.0/gamma)); frag_color = vec4(c, color.a); } None 0 90 0 4 1897888362496 -1 -1 -1 -1 {114bacfc-96b2-4738-8074-4390bbdc9b71} {9b0707c3-5c71-4cab-aa76-ee5e663a000f} 0 -1.77976 0.0350877