Hi,
I think there is a problem with the way Lighting.j3md works with Android. If I use an unshaded material, the ‘Color’ attribute works but if I use lighting, the equivalent, ‘diffuse’, doesnt. The object just comes out white.
[java]
// Lighting is on
// This works, cube is green
//Material m = new Material(am, “Common/MatDefs/Misc/Unshaded.j3md”);
//m.setColor(“Color”, ColorRGBA.Green);
// Cube is white on Android, green on PC.
Material m = new Material(am, “Common/MatDefs/Light/Lighting.j3md”);
m.setBoolean(“VertexLighting”, true);
m.setColor(“Diffuse”, ColorRGBA.Green);
geom.setMaterial(m);[/java]
Target is an HTC incredible S Android 2.3.5
Have I missed something?
Thanks
Simon
This would be true on the PC also, but you have to set UseMaterialColors to true for it to use the colors set on the material.
m.setBoolean( “UseMaterialColors”, true );
And because I got the link to look up the name for sure, I’ll include it here just in case it’s useful.
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:materials_overview
1 Like
Thats it!
You genius!
(Although, my testing does reveal that UseMaterialColours is not required on PC).
@sipickles said:
Thats it!
You genius!
(Although, my testing does reveal that UseMaterialColours is not required on PC).
then something else is wrong because it most certainly is required on the PC. If you use lighting.j3md you need UseMaterialColors=true to use material colors. This trips people up all the time.
That’s impossible. UseMaterialColors is most certainly required …
@Momoko_Fan said:
That's impossible. UseMaterialColors is most certainly required ..
Luke Skywalker said this same exact thing in Empire.
Well... except the UseMaterialColors part.
1 Like