Problem with Particle-Material


I updated my local Version of jME3 today and now I get an error with the Particle-Material:

I hope this works now. I couldn’t find a Site that could display the Error-Message, so I uploaded it to my own Server.

I create the Particles like this:


ParticleEmitter emit = new ParticleEmitter(texture+“Trail”, Type.Triangle, 50);





emit.setStartVel(new Vector3f(0, .5f, 0));



Material mat = new Material(Game.getGame().getAssetManager(), “Common/MatDefs/Misc/Particle.j3md”);

mat.setTexture(“m_Texture”, Game.getGame().getAssetManager().loadTexture(texture));



(texture is just a string with a filename)

The weird thing is, that the Test-classes from jME3 are working, but mine doesn’t, although it’s almost the same.

And here a couple of Screenshots.

What it’s supposed to look like:

and what it looks like now:

Am I doing something wrong or is there something wrong with jME3?

Unfortunately I can’t open the particleError.txt file, all I see is this:


Is it supposed to be a text file or what?

So from what I get in the screenshots, the particle size essentially doubled?

27.10.2010 23:31:34 com.jme3.renderer.lwjgl.LwjglRenderer updateShaderSourceData

WARNUNG: Common/MatDefs/Misc/Particle.frag compile error: ERROR: 0:4: ‘’ : #version must occur before any other statement in the program

27.10.2010 23:31:34 com.jme3.renderer.lwjgl.LwjglRenderer updateShaderSourceData


// TODO: Fix this so normal particles don’t need it.

// Only needed for certain GPUs.

#version 120


uniform sampler2D m_Texture;

varying vec4 texCoord;


varying vec4 color;

void main(){

if (color.a <= 0.01)




vec2 uv = mix(texCoord.xy,, gl_PointCoord.xy);


vec2 uv = texCoord.xy;


gl_FragColor = texture2D(m_Texture, uv) * color;


gl_FragColor = color;



27.10.2010 23:31:34 com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation

WARNUNG: Uniform m_VertexColor is not declared in shader.

How hard can it be to send a simple Text?:smiley:

Anyways, I made a Screenshot of the Error-Message:

Yep, it kinda doubled and the Flames don’t have a color anymore. They are just white.

I just realised that you can’t open the Big version of the Pictures above, so here are the two Links:


@norman: I don’t get it. If I copy the Error-Message from your post it works, but if I copy my error-message it doesn’t. I tried different Encodings etc, but it still won’t work.

I removed one “empty” line. Apparently it contained some special characters, dont know :slight_smile:

Intresting :smiley:

I just did another update of my jME3 and now the test-classes also don’t work anymore.

It crashes with the same Error-Message + this Exception:

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

java.lang.IllegalStateException: Cannot render mesh without shader bound

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(

at com.jme3.renderer.lwjgl.LwjglRenderer.setVertexAttrib(

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMeshDefault(

at com.jme3.renderer.lwjgl.LwjglRenderer.renderMesh(

at com.jme3.material.Material.render(

at com.jme3.renderer.RenderManager.renderGeometry(

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(

at com.jme3.renderer.queue.RenderQueue.renderQueue(

at com.jme3.renderer.RenderManager.renderViewPortQueues(

at com.jme3.renderer.RenderManager.flushQueue(

at com.jme3.renderer.RenderManager.renderViewPort(

at com.jme3.renderer.RenderManager.render(


at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(



@Momoko_fan I already noticed this issue, defines are injected to the shader (omg!) at the beginning of the file. So if we use defines and a shader with a version statement it fails because the version statement must be the first thing in the shader.

maybe we should check for this particular statement before wrting the defines to the shader.

I think we should not specify the #version statement in the shader, we specify it in the material like “VertexShader GLSL120 : …” then it can be appended on top of the defines instead of below.

Ok I added an issue (issue 232) in the tracker about that and I removed the #version120 in the particle shader

@Creativ could you test, if it works please?

Works again :slight_smile:

Thanks for the quick Fix.