SFML community forums

Help => General => Topic started by: bmn on April 16, 2011, 04:56:56 am

Title: Help with lightmanager
Post by: bmn on April 16, 2011, 04:56:56 am
I've been trying to use the lightmanager (http://www.sfml-dev.org/wiki/fr/sources/lightmanager) from the French wiki and everything works fine unless my walls are perfectly horizontal or vertical.  I'm guessing it's a divide by zero or similar mathematical error but I cannot seem to find it.

I've uploaded my source and compiled project Here (http://www.qfpost.com/download.do?get=4aef5bb71b26659140830529cb792961) so everybody can see the problem. The only change to the source is that unnecessary lines have been commented out.

(http://i53.tinypic.com/35hoifp.png)

The problem is with the lower of the two walls.
Title: Help with lightmanager
Post by: Groogy on April 16, 2011, 03:39:48 pm
Looks like you've removed one of the recursive calls to add triangles at the edges. I haven't looked at the source yet but will in a second.
Title: Help with lightmanager
Post by: bmn on April 16, 2011, 10:21:25 pm
I'm pretty sure I didn't.

The only things I've removed are walls and lights from main.cpp and the blur shader effect

EDIT: The Original Project (http://holyspirit.alpha-arts.net/Autres/Holyspirit%20Light%20Effect%20Test%20NEW.rar) also seems to have this problem.  Move your mouse around underneath the bottom-left walls and you should see this problem, so it's nothing I did.  Perhaps the same happens with your rbSFML port of the lightmanager?
Title: Help with lightmanager
Post by: bmn on April 28, 2011, 01:17:19 am
So I've tried everything I can think of and haven't fixed it yet.  Anybody got any solutions? If not, I'll start from scratch.
Title: Help with lightmanager
Post by: Mjonir on April 28, 2011, 01:43:41 am
Coincidentally the issue is being discussed on the French forum and has just been resolved, although the wiki has not been modified yet. Have a look at this thread:

http://www.sfml-dev.org/forum-fr/viewtopic.php?t=1682&start=15

Apparently some inequalities have to be modified for the expected result. The last post also says that this page contains a corrected code:

http://gregouar.developpez.com/tutoriels/jeux/moteur-lumieres-dynamiques-2d/

Hope it helps :)
Title: Help with lightmanager
Post by: bmn on April 28, 2011, 01:58:21 am
Aha, thanks much  :D