Some of my textures on models are very dark.
For example this road model:
But in editor it looks just fine.
Here is the code:
Spatial object = assetManager.loadModel(“Models/road1.j3o”);
object.setLocalTranslation(-10, 0, -10);
But some of my models are loaded fine, so I have this problem on some of the models. Can somebody help me please ?
What does the material look like?
I’d say it’s your Lighting Setup.
The Editor simply uses an directional ligh I think.
What is your Setup? And what happens when you leave out shadows?
You might have to change the ambient color to white in Order to have your object being ambient lit
DirectionalLight light = new DirectionalLight();
light.setColor(new ColorRGBA(1, 1, 1, 1));
light.setDirection(new Vector3f(-0.37f, -0.46f, -0.8f).normalize());
final int SHADOWMAP_SIZE = 8192;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 4);
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(assetManager, SHADOWMAP_SIZE, 4);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
Here is my lighting setup, if i change light.setColor(new ColorRGBA(1, 1, 1, 1)); to light.setColor(new ColorRGBA(7, 7, 7, 7)); for example, this model looks just fine, but other models are just white.
You shouldn’t use both the DirectionalLightShadowRenderer AND the DirectionalLightShadowFilter. Choose one them.
As stated on the wiki.
You only need one shadow simulation per light source: if you use shadow rendering, you won’t need a shadow filter and vice versa. Which way is more efficient depends partly on the complexity of your scene. All six shadow simulation classes have similar interfaces, so once you know how to use one, you can easily figure out the rest.
Also, what does the material for the road piece look like, I mean the j3m properties.
I am sorry, reply using email didn’t work it seems:
Jep then definately try your AmbientLighting or the Colors of the Material (Ambient, Specular, etc)
If you use a normal map, make sure you generate the tangents for the model