You don’t need to create a new material each time. Just change the alpha in the ‘color’ variable - it will change all the other stuff when rendering the next frame.
Like @pspeed said, you need to put that into the transparent (or translucent) bucket. Otherwise it will lead to visual errors in almost all scenes.
Maybe there is another stupid error in the Unshaded
material (some shader error or something like that). There have been several stupid and simple bugs been detected in jME 3 lately:
- What is the expected meaning of Light.clone()?
-
Positional audio - Wiki update please
(I guess it’s just the tip of the iceberg)