Passing alpha values through filters in JME 3.1


I am about to migrate to 3.1 and have a problem that I did not have with 3.0. I use a FilterPostProcessor as an atmospheric scattering and fog filter. It paints the color of the atmosphere and fog in the RGB components, and the “transparency” (=transmittance) of the atmosphere in the alpha component. I used to read this alpha value in another filter to render lights at certain intensities, i.e. the light intensity is a function of the transmittance.
The problem is, that in 3.1 the alpha value is not passed to the next filter(s). I assume that this is because the FilterPostProcessor uses Image.Format.RGB111110F in 3.1, while it used to be RGBA8 (or something similiar) in 3.0.

Is there anybody out there, who knows a trick to solve this problem?

I also encounter a transparent problem. Detail is I load an obj model, and set it transparent(BlendMode.Alpha, setMaterialTransparent, setQueueBucket(Bucket.Transparent)).
Then I add a skybox.
In 3.0 I can set skybox through the model, in 3.1 I can see viewport background color through the model.
But when I use jme’s Box ,Quad by new mesh, or load blender model, it’s ok in 3.1.

RGB111110F is used now because it allows for more precision on the color channels, at the expanse of…well the alpha channel… resulting in your issue :stuck_out_tongue:
I realize I could have made a fallback, maybe a constructor with the format so people could still use RGBA8 if they wanted.

For now what you can do though as a hackish workaround is to try to remove the PackedFloatTexture from the render caps. If they are not supported, the FPP falls back to RGBA8.


Tell me if it works.

This is absolutely not related with the original issue, please make your own topic.

Thank you for your reply.

Unfortunately it doesn’t work. In the FilterPostProcessor the fallback is:

if (!renderer.getCaps().contains(Caps.PackedFloatTexture)) {
    fbFormat = Format.RGB8;

That would be perfect. I guess there is something like RGBA16, which I’d like to use. :wink:

oh… I overlooked the RGB NOT-A 8… Yeah sorry.
I will do some thing like I said.

1 Like

Thank you very much.