Moonshine drawing shaders inside canvas = black screen

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Fabimawn
Prole
Posts: 8
Joined: Wed Jan 04, 2023 11:28 am
Location: Lua

Moonshine drawing shaders inside canvas = black screen

Post by Fabimawn »

Hello fellow readers, i'm posting this question because I can't seem to get the following to work after trying different stuff all day.

My game has a fixed 16:9 aspect ratio, you can resize the window, and you can see a backdrop, but the game itself renders in a canvas that auto adjusts based on your screen (main canvas that is always 16:9) (see the orientation pictures). My idea was to also make it possible to have the game screen be a blurred backdrop behind the main canvas to make it more clean looking. Of course when applying a gaussian fast shader behind the screen (see attached gaussian picture) and drawing the main canvas inside it, it works as expected, but all the space behind the main canvas is wasted computation (since you don't see it). I wanted to split it up in 2 parts. So 2 shaders that render above and underneeth the main canvas, or left and right (depending on the letterboxing) that have the canvas size needed. I tested this method and it was wayyy faster, but I couldn't get 2 different shaders to work since I discovered that Moonshine already uses a canvas (actually a buffer and active one) itself. This means I can't move them to the desired location, so I tried drawing the Backdrop.CanvasBlur.draw() functions (Moonshine chain.draw() function) on canvasses that I could then cast to a specific location with love.draw (above and under the main canvas). When doing that I get a black screen. That's the issue here. Does anyone know why that happens? Is there another way to do it? I also tried writing my own shader, but couldn't get it to look right.
Attachments
orientation 2.PNG
orientation 2.PNG (688.23 KiB) Viewed 295 times
orientation 1.PNG
orientation 1.PNG (677.1 KiB) Viewed 295 times
How I draw the canvas.PNG
How I draw the canvas.PNG (5.56 KiB) Viewed 295 times
Gaussian draw.PNG
Gaussian draw.PNG (7.54 KiB) Viewed 295 times
drawing in the canvas equals black screen.PNG
drawing in the canvas equals black screen.PNG (25.17 KiB) Viewed 295 times
User avatar
Fabimawn
Prole
Posts: 8
Joined: Wed Jan 04, 2023 11:28 am
Location: Lua

Re: Moonshine drawing shaders inside canvas = black screen

Post by Fabimawn »

And of course I got it working in the end just after posting this, but honestly I have no idea what I did wrong which is scary...
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 9 guests