daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lightShader2 = love.graphics.newShader[[
  2.     uniform vec3 ambience;
  3.     uniform vec2 player;
  4.  
  5.     vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords){
  6.       vec4 pixel = color * Texel(texture, texture_coords);
  7.      
  8.       vec4 pOut = pixel;
  9.  
  10.       pOut.rgb = pOut.rgb * ambience;
  11.  
  12.       float dist = distance(screen_coords, player);
  13.       float r = 100;
  14.  
  15.       if(dist < r){
  16.         vec3 lightColor = vec3(1, 1, 1);
  17.  
  18.         pOut.rgb = clamp(pOut.rgb + lightColor, vec3(0.0), pixel.rgb);
  19.       }
  20.  
  21.       if(screen_coords[0] >= 535 && screen_coords[0] <= 545){
  22.         pOut.rgb = vec3(1,1,1);
  23.       }
  24.  
  25.       if(screen_coords[1] >= 355 && screen_coords[1] <= 365){
  26.         pOut.rgb = vec3(0,0,0);
  27.       }
  28.  
  29.       return pOut;
  30.     }
  31.   ]]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top