Lighting crashes jme with nightly builds

so, ok. vanilla/updated jmp alpha4 with lighting.j3md works, while nightly buids give this:

INFO: Child (Light) attached to this node (Root Node)

Aug 14, 2011 12:49:26 PM handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

com.jme3.renderer.RendererException: Shader link failure, shader:Shader[language=GLSL100, numSources=2, numUniforms=15, shaderSources=[ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment]]] info:Fragment info

(127) : error C5051: profile does not support conditional returns
(210) : error C5051: profile does not support conditional returns
(127) : error C5051: profile does not support conditional returns

full log:
also, if you don't add lights to rootNode, it works, with ofcourse objects being black.
my graphics card Geforce fx5200 :/
haven't tested yet on the other newer card, but i really need jme to run on all cards

as I told you in the other thread this card is old, this came somewhere around the inception of shaders and the support wasn’t all that good, nvidia series 6 and equivalent ATI is just about the compatibility floor with shaders if you want them to work any good, I think there are fallbacks but nothing fully functional…on top of that, I dont think these fellas have supporting 6+ year old hardware high on their agenda…

Well, then. very sad because i’ll have to use another engine then.

and i liked the engine quite some…

cj45 said:
Well, then. very sad because i'll have to use another engine then.
and i liked the engine quite some...

note I said its not "high" on their agenda not that its not.............. something to consider

ok, it would be nice to have some clarification from developers, will they update their shaders, and if so when will it be?

I’ll base my decisions based on it

Even if you do switch engine, I can tell you that support for that old hardware will be minimal and output will unfortunately be abysmal.

My suggestion is to get a better card. They are pretty cheap if you go with the nVidia 200 series, less than a 100$.

i know that, but we really need to support these cards, besides its not an option atm to buy another card.

jme 3 is based around a modern shader architecture, i don’t really see a point spending time to support hardware which could probably be seen as obsolete in a few years. What we should be doing is concentrating on the new features being released, moving forward not back.

I agree with @wezrule The momentum is forward.

What I can suggest though is check google for fixes on that subject for your card series and modify the lighting shader yourself. I think that’s your best bet.

After you’ve found a solution submit it to the team and from there you should have support for near-obsolete hardware built-in.

ok, i could try.

goes to learn some glsl

after some searching through it, i found this in lightComputeDiffuse, i think this is whats giving me problems, ill go learn glsl now to try and fix it

if (shiny <= 1.0){

return 0.0;


edit: in Lighting.vert btw

Regarding this shader problem, I was having it too, so I just rolled back my jme3 jars from the newest version to the version from jME3_2011-03-29 and continued using the same models, guess what: the Renderer exception disappeared!



@biasutti That’s helpful and not helpful at the same time. Could you diff it? I’m sure @cj45 would appreciate it.

Yeah, well, that’s the problem. My first version trials with jme3 were with a release/binary version. In this pack there are only jar files and this release date identification is the jME3_2011-03-29 folder name. Sorry that I can’t tell you more. Just thought that any repository revision related to this date could provide some nice information. I’ve checked out the repository a month ago trying to make use of the upgrades to the engine and my application stopped working. Just yesterday I replaced the new version with my old one and now thinks are smooth again.

kind regards

Well then copy the old version you’re using? At least that’ll give us some comparison to start with and @cj45 could replace the one he’s working with that one.

Sure no problem, I shall upload it to my server and asap I post here a link. It may take a few days because my internet is broken and will hopefully be repaired today.

well, the problem is with the shaders using return statement within IF statement, i already made it work if i remove in Lighting.frag shader


float spotFallOff = 1.0;

if(g_LightDirection.w != 0.0){

vec3 L = normalize(;

vec3 spotdir = normalize(;

float curAngleCos = dot(-L, spotdir);

float innerAngleCos = floor(g_LightDirection.w) * 0.001;

float outerAngleCos = fract(g_LightDirection.w);

float innerMinusOuter = innerAngleCos - outerAngleCos;

spotFallOff = clamp((curAngleCos - outerAngleCos) / innerMinusOuter, 0.0, 1.0);

if(spotFallOff <= 0.0){

gl_FragColor.rgb = AmbientSum * diffuseColor.rgb;

gl_FragColor.a = alpha;





and remove from lightComputeSpecular

if (shiny <= 1.0){

return 0.0;


and change the only place where this function is called from

float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess);


if (m_Shininess <= 1.0) {

float specularFactor = 0.0; }

else {

float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess); }

done similar to vert shader too and it works.

now the problem is how would i go not removing the spotlight part, im now learning

glsl to do that, since ill need to know the math behind it.

oh and if you comment out return in the spotlight part, for some reason it gives

(51) : error C5041: cannot locate suitable resource to bind parameter “vPosition”

anyway, thanks for help

PS: sorry for my english skills

i guess you can have a boolean useSpotlight = true; and if its false, make it remove not working code with


Another one. You guys gonna fix it? Not everyone can afford a brand new computer. Software is written for the masses, not for the author. Other graphics engines can get around this bug. Why can’t yours?

I forgot to add: get your hands on a computer with an ATI Radeon X1200 in it. Or are you to good to use a computer that is more than a month old?