SHARE
TWEET

Untitled

a guest Apr 21st, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float lightValue1 = ls1.readNormalizedValue();
  2. float lightValue2 = ls2.readNormalizedValue();
  3.  
  4. if(lightValue1 < maxLight*2) {
  5.   maxLight = (maxLight * (1-alpha)) + lightValue1*alpha;
  6. }
  7. if(lightValue2 < maxLight*2) {
  8.   maxLight = (maxLight * (1-alpha)) + lightValue2*alpha;
  9. }
  10. if(lightValue1 > minLight/2) {
  11.   minLight = (minLight * (1-alpha)) + lightValue1*alpha;
  12. }
  13. if(lightValue2 > minLight/2) {
  14.   minLight = (minLight * (1-alpha)) + lightValue2*alpha;
  15. }
  16. lightValue1 = normalize(lightValue1, maxLight, minLight);
  17. lightValue2 = normalize(lightValue2, maxLight, minLight);
RAW Paste Data
Top