Author Topic: full screen mask with continuous changing alpha?  (Read 485 times)

Offline MichaelJPCT

  • long
  • ***
  • Posts: 136
    • View Profile
full screen mask with continuous changing alpha?
« on: July 07, 2016, 07:30:09 am »
i am trying to use Overlay to make a full screen mask. the mask must be able to change alpha from zero to full opacity, continuously.
i applied a black texture with alpha to the Overlay.
i tried different combination of alpha value(Texture) and transparency(Overlay), i just couldn't have it changing continuously.

1) Texture.setAlpha() has no effect on the Overlay, maybe an texture upload per frame is required.
2) i tried Texture.overrideTexelData(), it seemed to work. but it requires texture uploading, it clearly slows down the program.
3) the argument to Overlay.setTransparency() isn't the same thing as alpha, when i tried, 0 resulted in full transparency, 4 resulted in full opacity. and it's in integer, not float.

what else can i try?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: full screen mask with continuous changing alpha?
« Reply #1 on: July 07, 2016, 07:37:15 am »
Set Config.glTransparencyOffset=0 and Config.glTransparencyMul=0.01f and try again with setTransparency(). The default values are choosen to mimic desktop jPCT's software renderer (for historical reasons). I'm a bit unhappy with these values myself now, but if I change them now, I might break stuff that relies on them in the way they are.
No need for any texture manipulation/uploads or such things though.

Offline MichaelJPCT

  • long
  • ***
  • Posts: 136
    • View Profile
Re: full screen mask with continuous changing alpha?
« Reply #2 on: July 08, 2016, 08:27:44 am »
now it works perfectly. thanks.