Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lightShader2 = love.graphics.newShader[[
- uniform vec3 ambience;
- uniform vec2 player;
- vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords){
- vec4 pixel = color * Texel(texture, texture_coords);
- vec4 pOut = pixel;
- pOut.rgb = pOut.rgb * ambience;
- float dist = distance(screen_coords, player);
- float r = 100;
- if(dist < r){
- vec3 lightColor = vec3(1, 1, 1);
- pOut.rgb = clamp(pOut.rgb + lightColor, vec3(0.0), pixel.rgb);
- }
- if(screen_coords[0] >= 535 && screen_coords[0] <= 545){
- pOut.rgb = vec3(1,1,1);
- }
- if(screen_coords[1] >= 355 && screen_coords[1] <= 365){
- pOut.rgb = vec3(0,0,0);
- }
- return pOut;
- }
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement