How to do cleaner fog of war

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.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: How to do cleaner fog of war

Post by grump »

Gunroar:Cannon() wrote: Wed Nov 17, 2021 2:15 pm Oh, I've already got that worked out ... cheaply :ehem: :ultrahappy: . I just need to keep seeing the different types of implementations and see whether one will work for me or whether I should try something else.
Okay... sounds a bit unbelievable but okay. The "coolest" and most flexible way in my opinion to implement 2d shadow rendering is with signed distance fields, but it's also the approach that's most difficult to implement.

https://www.shadertoy.com/view/4dfXDn

Matt's solution with the polar transform that was linked above comes second.

https://github.com/mattdesl/lwjgl-basic ... ct-Shadows

The "no shader" limitation unfortunately means all high-performance GPU implementations are out the window and you have to make do with some sub-par hacky solution that looks and performs worse.

I'd recommend looking into one of the good solutions anyway, because anything else is going to be utter crap in comparison.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: How to do cleaner fog of war

Post by Gunroar:Cannon() »

Thanks for the Image
grump wrote: Wed Nov 17, 2021 3:45 pm
Gunroar:Cannon() wrote: Wed Nov 17, 2021 2:15 pm Oh, I've already got that worked out ... cheaply :ehem: :ultrahappy: .
Okay... sounds a bit unbelievable but okay
:rofl:
To be honest I was planning to do a normal POV grid based thing for determining what isn't seen :P
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: How to do cleaner fog of war

Post by milon »

Gunroar:Cannon() wrote: Wed Nov 17, 2021 2:15 pm ...Does it work with...like...alot of "polygons"(tiles). Which are alot on my screen.
Polygons are actual polygons, drawn with love.graphics.polygon() and "tiles" are usually defined as graphics (or quads of graphics) drawn with love.graphics.draw(). Polygons are generally slow and inefficient compared to drawing tiles. You used both terms - which are you drawing a lot of? ;)
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: How to do cleaner fog of war

Post by Gunroar:Cannon() »

I just figured tiles are a type of polygon in coding terms (to , like, fit it into the algorithm). So I do mean tiles, but for me to do the method I'll have to treat them as algorithms right?
milon wrote: Mon Nov 29, 2021 8:27 pm a lot of? ;)
:rofl:
Image
Funny thing is that autocorrect says "a lot", but my autocorrect misses words like "platformer" and others and whenever I type "alot" I'm always like "I KNOW this is how it's done. I just KNOW it must be" :rofl: Atleast now it's in my head for good, thanx thanks

Edit: That link seriously made my day :ultrahappy:
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests