I have a big problem because I can’t use more than one Object with the Lighting Material.
The situation is that I have a world and many Objects on it which you can also build, but when I build a new Object then the outer Object disapear and I can only see one. I hope somebody can help me.
You haven’t provided enough information here for us to help you.
Useful info:
-any errors?
-what sort of game it is
-what is your code for “building” and object?
-what does “disappear” mean and what is an outer object?
-any screenshots or a video to help
without testcase or code fragment i cant help you.
- No Errors
- A survival game
- Is not the game code but it is the same problem
/** Load a model. Uses model and texture from jme3-test-data library! */
Spatial teapot = assetManager.loadModel(“Models/stein.j3o”);
Material mat_default = new Material( assetManager, “Common/MatDefs/Light/Lighting.j3md”);
teapot.setMaterial(mat_default);
teapot.setLocalTranslation(0f, 2f, 0f);
rootNode.attachChild(teapot);
Spatial teapot2 = assetManager.loadModel(“Models/Holz.j3o”);
Material mat_default2 = new Material( assetManager, “Common/MatDefs/Light/Lighting.j3md”);
teapot.setMaterial(mat_default2);
teapot2.setLocalTranslation(0f, 2f, 0f);
rootNode.attachChild(teapot2);
- I can’t see both Objects (Mesh,…) at the same time
5.
http://cloud.ambarek.tk/public.php?service=files&file=%2Fbeardeddragon5%2Ffiles%2FUnbenannt2.PNG
http://cloud.ambarek.tk/public.php?service=files&file=%2Fbeardeddragon5%2Ffiles%2FUnbenannt.PNG
You set the material on teapot both times, not teapot2 ever.
I fixed that but the Problem is still there
Also, the objects are sitting at exactly the same location so maybe one is hiding the other. Try moving one of them to a different location, maybe.
That don’t make a change.
I must say that problem is only with Lighting, but a game without shadows …
http://www.youtube.com/watch?v=Bcy8bvhewtU
Ok it is not http://www.youtube.com/watch?v=Bcy8bvhewtU but it isn’t very nice to see
No, you are the only one having an issue of not being able to attach two objects with lighting material. You obviously do something wrong or have a very strange hardware/system issue. Try and make a test case, it will probably make you see whats the issue in your code.
Do you have an Ati HD 5970 or something like this?
@beardeddragon5 said:
That don't make a change.
I must say that problem is only with Lighting, but a game without shadows ...
As others have said, you have a big problem that is somehow in your setup. I using lighting all the time with hundreds of objects and I've never used shadows.
When you changed the local translation did it at least move the object?
Also, post a whole test case, not just the little snippet of code looks fine. That way we can spot the other problems there might be... and if you make a simple test case and everything works then that's important information for you too. (But for the love of all that is good, please use code blocks with the little "java" button.)

- I have a AMD Radeon HD 6670
[java]
package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.light.PointLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Spatial;
import com.jme3.shadow.PssmShadowRenderer;
/**
- test
-
@author normenhansen
/
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
setLight();
setUpLagerfeuer();
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void simpleRender(RenderManager rm) {
//TODO: add render code
}
private void setLight() {
/* A white, spot light source. /
PointLight lamp = new PointLight();
lamp.setPosition(new Vector3f(0f,3f,0f));
lamp.setRadius(40f);
lamp.setColor(ColorRGBA.Orange);
rootNode.addLight(lamp);
PssmShadowRenderer pssm = new PssmShadowRenderer(assetManager, 1024, 3);
pssm.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
viewPort.addProcessor(pssm);
}
private void setUpLagerfeuer() {
/* Load a model. Uses model and texture from jme3-test-data library! /
Spatial Lagerfeuer = assetManager.loadModel("Scenes/Lagerfeuer.j3o");
rootNode.attachChild(Lagerfeuer);
/* Load a model. Uses model and texture from jme3-test-data library! */
Spatial teapot = assetManager.loadModel("Models/stein.j3o");
Material mat_default = new Material( assetManager, "Common/MatDefs/Light/Lighting.j3md");
teapot.setMaterial(mat_default);
teapot.setLocalTranslation(0f, 2f, 0f);
rootNode.attachChild(teapot);
Spatial teapot2 = assetManager.loadModel("Models/Holz.j3o");
Material mat_default2 = new Material( assetManager, "Common/MatDefs/Light/Lighting.j3md");
teapot2.setMaterial(mat_default2);
teapot2.setLocalTranslation(0f, 2f, 0f);
rootNode.attachChild(teapot2);
}
}
[/java]
There is not a lot we can do with this test case, your Lagerfeuer.j3o asset is missing.
Anyway…i had a similar issue with my radeon 5970 and latest drivers. It looks like those drivers are messing with opengl…I had to restore Febuary 2011 drivers to have jme working correctly and i experienced a similar issue than yours (missing objects in the scene)
Ok that is very … .
However thanks for your help.
Do you see the scene and the last model? Or just the last model?
Did reverting the drivers work? This is really useful information!