Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by ak09

  1.  I found that a simple fragment shader for that would be something like:     uniform sampler2D Mtexture; void main() {     vec4 color = texture2D(Mtexture, gl_TexCoord[0].st);     gl_FragColor = vec4(1.0 - color.r, 1.0 - color.g, 1.0 - color.b, color.a); } And the OGL code:       glUseProgram(prog);     glBindFramebuffer(GL_FRAMEBUFFER, fbo);     glColor4f(1, 1, 1, 1);     glBindTexture(GL_TEXTURE_2D, tex);     glBegin(GL_QUADS);     glTexCoord2f(0.0f, 1.0f);  glVertex2i(0,0);         glTexCoord2f(1.0f, 1.0f);  glVertex2i(width,0);       glTexCoord2f(1.0f, 0.0f);  glVertex2i(width,height);       glTexCoord2f(0.0f, 0.0f);  glVertex2i(0,height);     glEnd();     glBindTexture(GL_TEXTURE_2D, 0);     glBindFramebuffer(GL_FRAMEBUFFER, 0);     glUseProgram(0); However, it's not giving me the expected results, and this is driving me crazy. Should I disable GL_BLEND before applying the filter? Case not, which function to use? Should I clear my texture before using a shader on it? <-- Never understood this
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!