I would like to control the visibility of this quad by fading it in and out. ie ramp the alpha value from 0 to 1.0 when I want to show it, and go from 1.0 to 0 when I want to hide it.
My problem is that I can’t seem to figure out how to implement that in code. Can someone help?
The company that I’m working for forked the JME2 code base and customized it for their needs. No one ever upgraded to JME3.x so that is why I’m stuck with having to use JME2.
In the article, the author states how to use a matrices in java to add a greater alpha (transparent) variable to the picture. you can isolate the texture and slowly make it transparent by increasing the alpha variable. I believe the more transparent it becomes, the more faded it is.
There should be a better way to handle this in JME using blend states? I don’t want to update each pixel’s alpha value and then rebind the new texture to the quad when changing the transparency of the texture. That would be really slow. There should be an easy way to control the overall alpha of the texture, I just don’t know the architecture of JME well enough to know how to implement the desired effect.
Unfortunately, I’m not sure anyone else does either.
I’ve been answering posts on this forum for about 6 years now and JME2 is before my time. I suspect most other users have moved on, too, unfortunately (for your issue).
I’m sure there is a way to do what you want to do… but I have no idea how to do it.
Setting up to display any transparent or semi-transparent texture:
-set blend mode to alpha on the material’s additional render state
-put the spatial in the transparent bucket
To fade it:
-make sure the UseMaterialColors Material parameter is set to true.
-set the “DiffuseColor” material parameter to white with an alpha value of the desired alpha… it will be multiplied with the texture.
I don’t know how many parallels there are with JME2. But that’s the general idea, I guess. mix the texture with a white color, fade using the color’s alpha.
As far as I remember, you can write shaders in GLSL with jME2.
Write a simple shader that multiplies the fragment with an alpha parameter.
AdditionalRenderState and transparent bucket should already been available in jME2.
I have some memories … but they are (haha) fading away…
I’m also interested in the original jME2 codebase (and jME1 too).
It would be very nice to just have that (for archive and historical research).
Since your company forked jME2 - the code might differ from the jME2 master.
Have you looked into Ardor3D continuation?
That’s another fork which was used by the NASA (I think) and other customers.
There is a developer here in the forum who manages that code (but can’t remember the name right now).