Hexagonal mosaic filter shader


this is shader of the Hexagonal mosaic filter ( in the ShaderX2 book)
what is wrong in this shader?

uniform sampler2D color_map_1,displacment_map;

void main(void)
   vec4 displacment = texture2D( displacment_map,gl_TexCoord[0] * 20);
   gl_FragColor = texture2D(color_map_1, gl_TexCoord[0] + displacment);

Maybee you should correct some details:

void main(void){
   vec4 displacment = texture2D( displacment_map,gl_TexCoord[0].xy * 20.0);
   gl_FragColor = texture2D(color_map_1, gl_TexCoord[0].xy + displacment.xy);

reading the compilers output may help too…


that is not correct.

my shader is completely wrong. i must re write this

i want Hexagonal mosaic filter effect on the:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.