(Resolved) Lighted objects are invisible


Thanks for that bit about light only affecting what is in its node/subnodes. I would not have guessed that myself, though I can see how that would be useful for making specific light sources only affect certain things.


I am trying to add lighting to my scene. I was using SimpleTextured.j3md and setting m_ColorMap to the texture with my color map. Am I mistaken in thinking that, if all I want is for unlit surfaces to appear dark, that I can just use Lighting.j3md instead and use the same color map texture with m_DiffuseMap?

The object displays fine with the SimpleTextured color map. When I change it to Lighting and use the color map as a diffuse map instead, my object is no longer visible. It’s not even showing up as a dark, black image as I would think something unlit should; it’s just invisible, and I can see the object behind it.

I went from this…

pre type="java"

Material material = new Material(getAssetManager(), “Common/MatDefs/Misc/SimpleTextured.j3md”);

material.setTexture(“m_ColorMap”, getAssetManager().loadTexture(“Models/planet.jpg”));


… to this…

pre type="java"

Material material = new Material(getAssetManager(), “Common/MatDefs/Light/Lighting.j3md”);

material.setTexture(“m_DiffuseMap”, getAssetManager().loadTexture(“Models/planet.jpg”));


And there is a light source nearby.

pre type="php"

PointLight light = new PointLight();



// getModel() here refers to a node just a few units away (<50) from the planets


Where is the flaw in my understanding of lighting?

First, the SimpleTextured material is deprecated, use Unshaded.j3md. Second, the light only propagates to subnodes, so attach it to the rootNode to affect all geometries.