Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help with lightmanager  (Read 3953 times)

0 Members and 1 Guest are viewing this topic.

bmn

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with lightmanager
« on: April 16, 2011, 04:56:56 am »
I've been trying to use the 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 so everybody can see the problem. The only change to the source is that unnecessary lines have been commented out.



The problem is with the lower of the two walls.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Help with lightmanager
« Reply #1 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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

bmn

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with lightmanager
« Reply #2 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 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?

bmn

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with lightmanager
« Reply #3 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.

Mjonir

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Help with lightmanager
« Reply #4 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 :)

bmn

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with lightmanager
« Reply #5 on: April 28, 2011, 01:58:21 am »
Aha, thanks much  :D