www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: MichaelJPCT on July 07, 2016, 07:30:09 AM

Title: full screen mask with continuous changing alpha?
Post by: MichaelJPCT 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?
Title: Re: full screen mask with continuous changing alpha?
Post by: EgonOlsen 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.
Title: Re: full screen mask with continuous changing alpha?
Post by: MichaelJPCT on July 08, 2016, 08:27:44 AM
now it works perfectly. thanks.