www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Uncle Ray on August 03, 2014, 12:32:06 pm

Title: How to set light's intensity?
Post by: Uncle Ray on August 03, 2014, 12:32:06 pm
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.
Title: Re: How to set light's intensity?
Post by: Irony on August 04, 2014, 06:26:11 am
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.
Title: Re: How to set light's intensity?
Post by: Uncle Ray on August 04, 2014, 10:53:02 am
I can't got it,255,255,255 means white.but how to adjust the degree of white?brightter or darker.
Title: Re: How to set light's intensity?
Post by: EgonOlsen on August 04, 2014, 05:15:52 pm
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.
Title: Re: How to set light's intensity?
Post by: Uncle Ray on August 05, 2014, 03:39:46 am
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.
Title: Re: How to set light's intensity?
Post by: Irony on August 07, 2014, 02:36:13 pm
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.