SceneComposer and Lighting

So in the SceneComposer I add an ambient light. The terrain I generated with the SDK shows up with light on it but my models don’t show up. They are basically invisible. If I go in the init for my code and add a light there my models show up. So why is it that the SceneCompser lights won’t reveal/show my model? Is there a setting i’m missing? I exported my models from blender with the ogre plugin.

[java]
private void setUpLight() {
// We add light so we see the scene
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White);
app.getRootNode().addLight(al);
}
[/java]

I knew it was something stupid.

Solution: The light has to be outside of everything in the SceneExplorer window. I had my light inside my terrain object so the light was only affecting it and nothing else. Go ahead and close this thread since I don’t know how to do it myself (If I even can).

You can also attach the objects to be lit to the root node of the scene to use light you placed, keeping the “base root node” for other things.

Hi,

I use an other hack : I move the lights from the loaded scene/area to app’s rootNode with :

[java]
/**
* Move lights from src (ex: area) to dest (ex: rootNode) and enable shadow for directinalLigths
*/
static void initLights(Spatial src, Spatial dest, AssetManager assetManager, ViewPort viewPort) {
for (Light l : src.getLocalLightList()) {
dest.addLight(l);
if (l instanceof DirectionalLight) {
System.out.println(“FOUND Light”);
shadow((DirectionalLight) l, assetManager, viewPort);
}
}
src.getLocalLightList().clear();
}
[/java]

May be the wrong way :wink: