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

Author Topic: SFML Light System - Let There Be Light  (Read 230887 times)

0 Members and 1 Guest are viewing this topic.

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #165 on: December 03, 2012, 02:42:26 am »
hell yeah i'm interested in it :D

I so would like something like this for my terraria clone of a game. just please make sure it uses cmake and compiles on linux out of the box. so annoying when people use visual studio's crappy buildsystem.

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #166 on: December 03, 2012, 04:18:57 pm »
Quote
just please make sure it uses cmake and compiles on linux out of the box

I agree.  ;)

 I will wait until the previous functionality (Let There Be Light 1.51) be stable in the new GLLight2D.

Thank you very much lolz123 for the work, and thank you for  uploading the project to Github!  ;D

DJuego


Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #167 on: December 03, 2012, 04:45:45 pm »
oh yes indeed, glad it's on github as well, way easier to look at/use, and if we need to patch it..say hello to merge requests ;)

danikaze

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
Re: SFML Light System - Let There Be Light
« Reply #168 on: December 04, 2012, 04:30:37 am »
Unfortunately, I am not very familiar with Code::Blocks. Try adding it under Build Options -> Search Directories -> Linker.

But the linker is for .dll, .a and so, right?
Does the code needs to be compiled?

I'm not very used to C::B either... I come from VS2010 but wanted to try this in order to portability to Linux and Mac...

danikaze

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
Re: SFML Light System - Let There Be Light
« Reply #169 on: December 06, 2012, 09:14:21 pm »
Ok. Finally I moved back to MSVC2010 and tried to use LTBT, but this is what I get...

Code: [Select]
1>AABB.obj : error LNK2001: unresolved external symbol __imp__glVertex2f@8
1>AABB.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>AABB.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>Color3f.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
1>ConvexHull.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
1>ConvexHull.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glColor4f@16
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glPopMatrix@0
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glPushMatrix@0
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
1>EmissiveLight.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2i@8
1>Light.obj : error LNK2001: unresolved external symbol __imp__glOrtho@48
1>Light.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
1>Light.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
1>Light.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glColor4b@16
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glDisable@4
1>LightSystem.obj : error LNK2001: unresolved external symbol __imp__glBlendFunc@8

Any idea? Anyone?

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #170 on: December 06, 2012, 09:35:51 pm »
You have to link to OpenGL.

Just add OpenGL32.lib under linker > input.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

danikaze

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
Re: SFML Light System - Let There Be Light
« Reply #171 on: December 06, 2012, 10:15:37 pm »
You have to link to OpenGL.

Just add OpenGL32.lib under linker > input.

Thanks, now it works! :)
It would be nice if you included depencencies, or at least a list of them in your git/svn/sourceforge releases :)

Anyway, a question. It's worth using this LTBL 1.5.1? Or the GL version will change the API too much?

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #172 on: December 07, 2012, 01:07:27 am »
It will be a while until GLLight2D is done, so it would probably be best to stick with LTBL 1.5.1 for a while. The API will change quite a bit. However, if you don't need any of the additional features (normal and specular mapping, HDRR with tone mapping and bloom), it is probably better to stay with LTBL anyways since it works better with SFML.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

foobarbaz

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #173 on: December 10, 2012, 11:05:51 am »
Hi, I just started with SFML today and set up my basic framework and decided to get your light system in it since it looks absolutely beautiful :)

The demo works fine on my computer, but for some reason when I compile your example myself against the latest SFML on GIT I get the screenshot below (I had to add a few cmath and stdlib includes here and there, and also comment out the m_lightAttenuationShader.unbind(); line in LighSystem.cpp). Which version is this supposed to be compiled against?



EDIT: I fixed it! It's working fine now. It turns out m_lightAttenuationShader.unbind(); was important. I replaced it with:

Code: [Select]
//this is the replacement for unbind
sf::priv::GlContext::ensureContext();
glCheck(glUseProgramObjectARB(0));

since the unbind function was removed in this commit: https://github.com/SFML/SFML/commit/121cfeb6a3685e2529b717d5667ee6601533c30e
« Last Edit: December 10, 2012, 12:31:20 pm by DrSuperSocks »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML Light System - Let There Be Light
« Reply #174 on: December 10, 2012, 10:46:48 pm »
You can safely remove the call to sf::priv::GlContext::ensureContext().
Laurent Gomila - SFML developer

foobarbaz

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #175 on: December 11, 2012, 12:28:12 am »
Awesome, thanks!

grant

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: SFML Light System - Let There Be Light
« Reply #176 on: December 14, 2012, 06:02:41 am »
Hi, I made a game with 3 other students for a term project and we used LTBL in it.  I thanked CireNeikual in the credits.  Here's a link to the website if you want to download and play it: https://sites.google.com/site/offby1games/.  Also here's a link to the trailer: .  Anyways thanks lolz123 for the light system you made, and thank you, Laurent for SFML.  This is the first game I've made besides game maker games, and I really enjoyed it and intend to make more.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
AW: SFML Light System - Let There Be Light
« Reply #177 on: December 14, 2012, 11:14:27 am »
This looks really great!
You should open a thread in the project section of this forum, so more people could discover it. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

pjuke

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #178 on: January 15, 2013, 02:28:00 pm »
Nice one, looking good!
I've one question tho:

What would be the best approach when dealing with circular objects, like a ball for example?
A circle has "endless" number of corners, which makes it a bit difficult to point out all the vertices in the shape, I guess.

So, how would I go by defining those kind of objects with soft corners?

Stormblessed

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #179 on: January 17, 2013, 06:01:48 am »
I was wondering if anyone could perhaps state what exactly you need to have linked to get this to compile, I know it says SFML and GLEW, but I read somewhere that SFML includes GLEW for you, which confuses me.  I'm using Code::Blocks as my IDE so that I can run it off of a flash drive, not sure if that matters at all, probably not... 

As of right now I've got all the stuff in SFML/lib/ linked under Build Options -> Linker settings.
And under Build  Options -> Search directories -> linker  as well as Build Options -> Search directories -> compiler I've got LTBL included, as well as SFML/include under compiler and SFML/lib under linker.

I've been using SFML in my project, so that works for sure.  But whenever I try to #include any of the LTBL files it can't find them.

Some tips would be greatly appreciated, as in all honesty I sometimes find setting up the IDE to work with what you want to be the hardest part of programming...
Embrace success, don't condemn it.

 

anything