No shadows

Hi all,

im trying to make a small game where your a space ship in our solar system.

i got a obj model of a spaceship… but when i turn my ship to the sun, its all grey becouse it does not recieve light.

how can i make sure it is always visible?

i tried setting lightCombineMode to off, but it becomes white then.



thank you for your help

Well, that is what you would expect if having only one light source…



You should try adding some more lights with gray color, make your ambient be completely black, and have one main light being white completely to simulate your sun. That would certainly help.

thank you for your reaction,

but my question is more, can i make sure my model isnt affected by light, but that it is visible.

like when you set a default colour on a object.

Use the MaterialState to color your object.

The ambient color is the color if there is no light affecting your object, you could also set a emissive color, if you want your spaceship to emit a certain color.

I guess its best if you just take a Simple Sphere and a Lightsource and see what the different MaterialState and Light combinations do.

MaterislState

I know material state,

but im using a model here, i was wondering if there was a way to effect the whole model in a simple way.

or should i use material state on each part of the model?

Ok i used material state now, by making a material state with the colours of the diffuse colour

in case anyone else needs it:

   
MaterialState ms;      
for(int i = 0;i<model.getQuantity();i++){
  ms = (MaterialState)model.getChild(i).getRenderState(TextureState.RS_MATERIAL);
  ms.setEmissive(ms.getDiffuse());
  model.getChild(i).setRenderState(ms);
}


Thank you all for your help