Page 1 of 1

Problems with Moonshine shaders

Posted: Sat Sep 08, 2018 9:37 pm
by the_spice_must_flow
I'm having a problem with the Moonshine modules. Attempting to draw the shader causes the screen to go black instead of correctly applying the shader. I have a few draw wrapper functions in the Kernel module, drawShader, drawQuadShader, and drawTextShader. These wrapper functions call Moonshine. The shader works correctly if you comment out line 214 of scenes/maingame.lua, add

Code: Select all

 effect = moonshine(moonshine.effects.crt)
into love.load() and

Code: Select all

 effect.draw(function()
      love.graphics.draw(love.graphics.newImage("/res/background.png"), 0 ,0)
    end)
    
into love.draw()
You can reproduce the black screen error by uncommenting line 216 of scenes/maingame.lua
Does anyone know what the problem is? I am finding this even more wonky than the problems I am having with my chunk loader.

Here is a stripped down copy of my .love file, for clarity.
starhack.love
(9.18 MiB) Downloaded 120 times

Re: Problems with Moonshine shaders

Posted: Sat Sep 08, 2018 9:53 pm
by zorg
What's line 214 (or 216, since you apparently can't decide which line number it is :3) of scenes/maingame.lua?

Re: Problems with Moonshine shaders

Posted: Sat Sep 08, 2018 10:21 pm
by the_spice_must_flow
Uncommenting line 216 will attach the black screen shader to the background entity.
Commenting out line 214 Will remove the background from the world, so there isn't a duplicate image when adding the code I posted to main.lua