Need Advice on Editing Lighting J3MD for Apple M1 color issue

I have been dealing with issues on the Apple M1 processors with JME in a Swing window. I have been unable to upgrade to the newer version of JME because of incompatibility with Swing and the new version of LWJGL.

I am looking for some assistance in taking the Lighting j3md duplicating it and swapping the Red and blue channels to correct the issue I am currently experiencing. Would anyone be able to assist me with this conversion?

Thank you for your time.

I’m still a noob at GLSL/J3MD, but I will help you if no one else volunteers.


Reminds me of this recent jMonkey thread Colors are inverted on Apple M1 chip – If you haven’t read that might be some things to try in there. Looks like they are working on something but not quite there yet Apple Silicon flips red and blue color channels giving distorted colors #125

Sorry if you have read that already or if it’s totally unrelated. These m1 apples seem to be tricksy lately

1 Like

If it’s as simple as it sounds, this should do it. Put this at the end of Lighting.frag (untested):

float red = gl_FragColor.r;
gl_FragColor.r = gl_FragColor.b;
gl_FragColor.b = red;

But really, it sounds like this fix should be somewhere in the renderer.


Thank you that fixes my immediate need.

I been reading through the other threads in regards to M1.
I have a swing app that implement JME using legacyApplication in a swing window. This currently does not play nice with LWJGL3 and I am waiting to see how the overhaul comes along from MacOS support overhaul, Apple M1 and breaking changes.

Thank you everyone for your replies!