How to set light's intensity?

Started by Uncle Ray, August 03, 2014, 12:32:06 PM

Previous topic - Next topic

Uncle Ray

Light.setIntensity(r,g,b) is uesed to set colors,but i don't want to change color, just want to change the  intensity of the light.
how can i do?

Thanks for Ego.

Irony

You can do both with this function. Light always has a "color"; If you want white light (the default), set r=b=g, e.g. to 255 for maximum brightness.

Uncle Ray

I can't got it,255,255,255 means white.but how to adjust the degree of white?brightter or darker.

EgonOlsen

It's doesn't whiter than white, so you can't increase the intensity above 255,255,255. You can you lower values...it's just like in any paint program if you are picking some color.

Uncle Ray

Thanks above everyone, i now know it,rgb not only means the color but also means the strength of light.Strong light or weak light all belong to RGB.

Irony

In case you still wonder why your lights and textures are kinda dark:
You probably have, as all people, set your device to automatic brightness. This is rather dark for games.

You can try this snippet:

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 1.0; // or whatever
getWindow().setAttributes(lp);

to override brightness settings.

Not all devices or users will like that, but it may be worth a try. In Armada, I set the brightness to 0.85 per default, but the user can deactivate the override.