Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualLorenzoGatti

Posted 25 January 2013 - 10:35 AM

As always, complete code samples would be better:
  • What do you put into Colors[]? How is it animated?
  • What's the point of GL_ALPHA_TEST? Don't you want to draw arbitrary stuff first, and an increasingly opaque rectangle over whatever you are fading out last, unconditionally? Every fragment should be a*fade colour + (1-a)*stuff colour, with a (Colors[4] for you) increasing from 0 to 1 and ignoring the alpha value of the fading stuff.
  • When do you draw the stuff you are fading out, and in which OpenGL state? I only see pFade->Draw(), which I suppose contains only the rectangle in the second snippet.

#2LorenzoGatti

Posted 25 January 2013 - 10:35 AM

As always, complete code samples would be better:
  • What do you put into Colors[]? How is it animated?
  • What's the point of GL_ALPHA_TEST? Don't you want to draw arbitrary stuff first, and an increasingly opaque rectangle over whatever you are fading out last, unconditionally? Every fragment should be a*fade colour + (1-a)*stuff colour, with a (Colors[4] for you) increasing from 0 to 1 and ignoring the alpha value of the fading stuff.
  • When do you draw the stuff you are fading out, and in which OpenGL state? I only see pFade->Draw(), which I suppose contains only the rectangle in the second snippet.

#1LorenzoGatti

Posted 25 January 2013 - 02:29 AM

As always, complete code samples would be better:

  • What do you put into Colors[]? How is it animated?
  • What's the point of GL_ALPHA_TEST? Don't you want to draw arbitrary stuff first, and an increasingly opaque rectangle over whatever you are fading out last, unconditionally? Every fragment should be a*fade colour + (1-a) stuff colour, with a (Colors[4] for you) increasing from 0 to 1 and ignoring the alpha value of the fading stuff.
  • When do you draw the stuff you are fading out, and in which OpenGL state? I only see pFade->Draw(), which I suppose contains only the rectangle in the second snippet.

PARTNERS