Advertisement
tyridge77

Untitled

Feb 16th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. int red = (int) (pixelcolor.getRed()*(1-(clamp(distance_from_lightsource/light.Range,0.0f,1.0f))));
  2. int green = (int) (pixelcolor.getGreen()*(1-(clamp(distance_from_lightsource/light.Range,0.0f,1.0f))));
  3. int blue = (int) (pixelcolor.getBlue()*(1-(clamp(distance_from_lightsource/light.Range,0.0f,1.0f))));      
  4.  
  5. g.setColor(new Color(red,green,blue));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement