diff --git a/src/main.lua b/src/main.lua index 10bf1e6..547c6f8 100644 --- a/src/main.lua +++ b/src/main.lua @@ -2185,35 +2185,31 @@ function love.update(dt) update_screenshake(dt) end --< love.update() -local has_background = true function love.draw() if Config.Debug.IS_ASSERT then assert_consistent_state() end -- This clears crt and background color each frame start. if not true then LG.clear(1, 1, 1, 1) end - --- @type number - local alpha = dt_accum * Config.FIXED_DT_INV - - local blend_mode = LG.getBlendMode() + local alpha = dt_accum * Config.FIXED_DT_INV --- @type number - LG.setBlendMode('screen', 'premultiplied') do + local blend_mode = LG.getBlendMode() + LG.setBlendMode('screen', 'premultiplied') do LG.setShader(glsl_shaders.warp) - if has_background then -- Draw background fill, else background color shows up─if menu/pause else use LG.clearBackground()) + do LG.rectangle('fill', 0, 0, arena_w, arena_h) end - LG.setShader() --> glsl_shader.warp + do + LG.setBlendMode('add', 'premultiplied') + Shaders.phong_lighting.shade_any_to_player_pov(function() draw_background_shader(alpha) end) + LG.setBlendMode('screen', 'premultiplied') + end + LG.setShader() --< end of glsl_shader.warp end - - LG.setBlendMode('add', 'premultiplied') - moonshine_shaders.fog(function() end) - Shaders.phong_lighting.shade_any_to_player_pov(function() - draw_background_shader(alpha) --[[]] - end) + LG.setBlendMode(blend_mode) --< end of 'screen' end - LG.setBlendMode(blend_mode) -- end of 'screen' -- Draw background fill, else background color shows up (maybe use LG.clearBackground()) --- PERF: A glow radial gradient texture may help shader switch calls @@ -2223,6 +2219,7 @@ function love.draw() -- screen|lighten work well LG.setBlendMode(Config.Debug.IS_DEVELOPMENT and 'multiply' or 'screen', 'premultiplied') Shaders.phong_lighting.shade_any_to_player_pov(function() LG.rectangle('fill', 0, 0, arena_w, arena_h) end) + moonshine_shaders.fog(function() end) LG.setBlendMode(blend_mode) end diff --git a/src/shaders/phong_lighting.lua b/src/shaders/phong_lighting.lua index 92657c3..c34a74d 100644 --- a/src/shaders/phong_lighting.lua +++ b/src/shaders/phong_lighting.lua @@ -1,7 +1,7 @@ local LG = love.graphics local common = require 'common' -local LIGHT_DEFAULT_ANY_TO_PLAYER_POV_DIFFUSE_COLOR = { 0.7, 0.7, 0.6 } -- error.. shouldn't be triggered, as player action must always be defined +local LIGHT_DEFAULT_ANY_TO_PLAYER_POV_DIFFUSE_COLOR = { 0.8, 0.8, 0.7 } -- error.. shouldn't be triggered, as player action must always be defined local LIGHT_DEFAULT_PLAYER_TRAIL_DIFFUSE_COLOR = { 0.5, 0.5, 0.5 } -- error.. shouldn't be triggered, as player action must always be defined local LIGHT_DIFFUSE_COLORS = common.PLAYER_ACTION_TO_COLOR