Page 1 of 1

Issues porting light_world.lua to 11.1 from 0.10.1

Posted: Sat May 19, 2018 12:35 pm
by MissDanish
So I've been using a modified version of light vs shadow for my game, but it has some pretty bad vram issues, and it also doesn't allow you to set a light range from the function that spawns in a light so you have to do it with another function which isn't very clean. Despite all my improvements to the system such as moving the culling calculations over to the CPU and making it work better with scaling it's still too heavy, while playable on high end systems and most med end systems, anyone with a graphics card below something like a R9 270 or R7 260 would struggle to run my game at a reasonable frame rate.

On this map I made it uses 1.5 GIGABYTES of VRAM (at 720p, if I change the resolution to 1080p it goes up to 3.3 gigabytes o_o)
Image

If I turn the lights off the VRAM goes down to <90 megabytes
Image

So this is where the light_world library comes in, I got suggested to switch over to it on the löve discord. So I downloaded it and as I suspected it threw me a BUNCH of errors related to 11.x changes that has occurred since 0.10.1 (the löve version light_world was made for).
After about 1-2 hours of work I managed to get all the errors to stop. Then I put in some lights to test:
Image

So all is good right? WRONG. NOTHING happened when I ran the code, just a black screen:
Image

I have no idea what the issue is, I will continue and try to fix it on my own, but if anyone wants to try and figure out what's going on they can download my attempt at updating it to 11.1 here:
light_world v2.zip
(17.76 KiB) Downloaded 107 times
Also here's a link to the light_world github:
https://github.com/tanema/light_world.lua

And it's wiki:
https://github.com/tanema/light_world.lua/wiki

EDIT: also I removed the post shader system, it had a ton of issues. If anyone wants to re-implement that they can, but it's not necessary for the system to work at all.

EDIT2: I also added this pull request to the system:
https://github.com/tanema/light_world.l ... a656012b46

Re: Issues porting light_world.lua to 11.1 from 0.10.1

Posted: Thu May 24, 2018 9:10 pm
by joedono
I use tanema's light_world in my own project, which still uses LOVE 0.10.2. It's the only thing holding me back from upgrading.

As an experiment, I tried removing the post shader system to see what it would do to my game, and I started getting an entirely black screen, just like you. I think the post_shader is necessary for light_world to actually draw the lights. I did a quick glance through the other files to see if I could piece together what you changed, and I didn't find much other than removing the post_shader, updating the calls to love.graphics.setColor(), and reworking the temporary canvas thing in util.process(). Maybe a summary of the other changes might narrow down the problem, assuming that you're right and I'm wrong about the post_shader being necessary.

Re: Issues porting light_world.lua to 11.1 from 0.10.1

Posted: Fri May 25, 2018 12:06 am
by bobbyjones
This library works with 11.1. It currently has an issue with heightmaps but it is in active development. I tested it on my machine and it seems to work fine performance wise