Problem using Lighting.j3md

I have just started to implement some very simple experiments with JME3 SDK.



A textured quad using Unshaded.j3md works fine, but trying the same thing with Lighting.j3md gives an error:



INFO: Uniform m_VertexColor is not declared in shader [ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]].



The code:



[java]

public void simpleInitApp()

{

Quad q = new Quad(1.0f, 1.0f);

Geometry g = new Geometry("Quad", q);

Material m = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");

g.setMaterial(m);

Texture t1 = assetManager.loadTexture("Textures/green_square.png");

m.setTexture("DiffuseMap", t1);

rootNode.attachChild(g);

}

[/java]

Its not an error, its an “INFO”, see the beginning of the log message

True :slight_smile:



To be clear, the error is that nothing gets displayed.



I presume that this shader works just fine (it’s part of the SDK) so it’s a newbie config/app issue.



The code works if I use Unshaded.j3md.



[java]

public void simpleInitApp()

{

Quad q = new Quad(1.0f, 1.0f);

Geometry g = new Geometry(“Quad”, q);

Material m = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);

g.setMaterial(m);

Texture t = assetManager.loadTexture(“Textures/green_square.png”);

m.setTexture(“ColorMap”, t);

rootNode.attachChild(g);

}

[/java]

Oh, in that case you don’t have a light …

1 Like

Awesome. Thanks.