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

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

0 Members and 1 Guest are viewing this topic.

dragondgold

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Re: SFML Light System - Let There Be Light
« Reply #210 on: May 15, 2013, 04:50:44 am »
You have to #include <LTBL/Light/Light_Point.h>

Almost the same error  :-\

make all
Building file: ../src/PruebaLightSFML.cpp
Invoking: GCC C++ Compiler
g++ -I/home/andres/Dropbox/Development/SFML-2.0/include -I/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"src/PruebaLightSFML.d" -MT"src/PruebaLightSFML.d" -o "src/PruebaLightSFML.o" "../src/PruebaLightSFML.cpp"
In file included from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs.h:5:0,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/Light.h:29,
                 from /home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Light/Light_Point.h:25,
                 from ../src/PruebaLightSFML.cpp:7:
/home/andres/Dropbox/Development/Let_There_Be_Light_v1.5.1/Source/LTBL/Constructs/AABB.h:54:15: warning: class &#8216;AABB&#8217; is implicitly friends with itself [enabled by default]
Finished building: ../src/PruebaLightSFML.cpp
 
Building target: PruebaLightSFML
Invoking: GCC C++ Linker
g++ -L/home/andres/Dropbox/Development/SFML-2.0/lib -o "PruebaLightSFML"  ./src/PruebaLightSFML.o   -lthor -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system
./src/PruebaLightSFML.o: In function `main':
/home/andres/Dropbox/workspace/PruebaLightSFML/Debug/../src/PruebaLightSFML.cpp:31: undefined reference to `ltbl::Light_Point::Light_Point()'
/home/andres/Dropbox/workspace/PruebaLightSFML/Debug/../src/PruebaLightSFML.cpp:32: undefined reference to `Vec2f::Vec2f(float, float)'
collect2: ld returned 1 exit status
make: *** [PruebaLightSFML] Error 1

PD: Also I have the same errors with LightSystem, seems like nothing of ltbl is working. I will try creating a new Eclipse project tomorrow.
« Last Edit: May 15, 2013, 05:26:02 am by dragondgold »

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #211 on: May 15, 2013, 01:54:42 pm »
It seems to me like you re misusing its classes, or in case you re compiling the sample, it just is outdated..

Not sure tho. But this lighting system does work

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #212 on: June 04, 2013, 05:18:03 pm »
Hi There,

I tried this code:

        // LTBL
        ls = ltbl::LightSystem(AABB(Vec2f(0.0f, 0.0f), Vec2f(static_cast<float>(WIN_WIDTH), static_cast<float>(WIN_HEIGHT))), window.get(), "data/lightFin.png", "data/shaders/lightAttenuationShader.frag");

        ltbl::Light_Point* dLight = new ltbl::Light_Point();
        dLight->SetCenter(Vec2f(0.0f, 0.0f));
        dLight->SetRadius(750.f);
        dLight->m_size = 30.f;
        dLight->SetSpreadAngle(2.0f * static_cast<float>(M_PI));
        dLight->m_softSpreadAngle = 0.0f;
        dLight->CalculateAABB();

        ls.AddLight(dLight);

And i get this when compiling:

1>------ Build started: Project: Testing, Configuration: Release Win32 ------
1>  main.cpp
1>F:\SFML-2.0-x64\include\SFML/Graphics/Shader.hpp(521): error C2248: 'sf::NonCopyable::operator =' : cannot access private member declared in class 'sf::NonCopyable'
1>          F:\SFML-2.0-x64\include\SFML/System/NonCopyable.hpp(79) : see declaration of 'sf::NonCopyable::operator ='
1>          F:\SFML-2.0-x64\include\SFML/System/NonCopyable.hpp(42) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Shader &sf::Shader::operator =(const sf::Shader &)'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Am i doing something wrong?

I'm using LTBL 5.1 + SFML 2.0
こんな私も変われるのならもし変われるのなら白になる

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #213 on: June 04, 2013, 07:51:31 pm »
It looks like you are copying the light system. Try initializing it like this:

ltbl::LightSystem ls(AABB(Vec2f(0.0f, 0.0f), Vec2f(static_cast<float>(WIN_WIDTH), static_cast<float>(WIN_HEIGHT))), window.get(), "data/lightFin.png", "data/shaders/lightAttenuationShader.frag");
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #214 on: June 04, 2013, 07:57:48 pm »
It looks like you are copying the light system. Try initializing it like this:

ltbl::LightSystem ls(AABB(Vec2f(0.0f, 0.0f), Vec2f(static_cast<float>(WIN_WIDTH), static_cast<float>(WIN_HEIGHT))), window.get(), "data/lightFin.png", "data/shaders/lightAttenuationShader.frag");

that did work somehow but now I get this:

1>------ Build started: Project: Testing, Configuration: Release Win32 ------
1>  main.cpp
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall Vec2f::Vec2f(float,float)" (??0Vec2f@@QAE@MM@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall AABB::AABB(class Vec2f const &,class Vec2f const &)" (??0AABB@@QAE@ABVVec2f@@0@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ltbl::LightSystem::RenderLightTexture(void)" (?RenderLightTexture@LightSystem@ltbl@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ltbl::LightSystem::RenderLights(void)" (?RenderLights@LightSystem@ltbl@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall ltbl::LightSystem::~LightSystem(void)" (??1LightSystem@ltbl@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall ltbl::LightSystem::LightSystem(class AABB const &,class sf::RenderWindow *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0LightSystem@ltbl@@QAE@ABVAABB@@PAVRenderWindow@sf@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ltbl::Light::SetCenter(class Vec2f)" (?SetCenter@Light@ltbl@@QAEXVVec2f@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ltbl::Light::SetRadius(float)" (?SetRadius@Light@ltbl@@QAEXM@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall ltbl::Light_Point::SetSpreadAngle(float)" (?SetSpreadAngle@Light_Point@ltbl@@QAEXM@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall ltbl::Light_Point::Light_Point(void)" (??0Light_Point@ltbl@@QAE@XZ)
1>F:\Bibliotecas\Documentos\Visual Studio 2012\Projects\SlimeWorld\Release\Testing.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I've include the headers to my MSVS IDE. How should I do this to also compile LTLB? Because
I believe those errors are because when compiling, since LTBL has no libraries it's looking for them.
« Last Edit: June 04, 2013, 08:01:54 pm by Sakurazaki »
こんな私も変われるのならもし変われるのなら白になる

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #215 on: June 04, 2013, 08:02:17 pm »
You need to add the source as a library directory as well. Go to VC++ Directories and add the Source folder under Library Directories.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #216 on: June 04, 2013, 08:22:35 pm »
You need to add the source as a library directory as well. Go to VC++ Directories and add the Source folder under Library Directories.

I did it but i get the same error
こんな私も変われるのならもし変われるのなら白になる

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #217 on: June 04, 2013, 08:28:05 pm »
Try adding the source to your project directly (so it appears in the solution explorer).
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #218 on: June 04, 2013, 08:40:41 pm »
Try adding the source to your project directly (so it appears in the solution explorer).

I already tried and when compiling it says it cant find LTLB/QuadTree/StaticQuadTree.h

Damn I only want to use this library >.<
こんな私も変われるのならもし変われるのなら白になる

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #219 on: June 06, 2013, 02:04:26 pm »
Okay,

I finally added all the library to my project as internal, changing includes and everything.

Now after compiling, every light or convexhull i create, doesnt render.

See this screenshot:
http://screencloud.net/v/gJEC

As you can see, No lights are rendered, despite I can see their AABB debugRender rectangle.
Also, no light is emitted and no shadow is cast. The hull can't also be seen.

Is it because I'm missing something?

Btw I had to change some parts of the code. Some of the textures where calling .bind() function
and since now bind is bind(sf::texture*) I changed those lines for sf::Texture::bind(&texture);
こんな私も変われるのならもし変われるのなら白になる

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #220 on: June 06, 2013, 04:54:21 pm »
Are you rendering a background? You won't be able to see the lights without non-black background. Also, can you share the code where you are rendering the light system?
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #221 on: June 06, 2013, 07:46:20 pm »
EDIT:

Putting background AND adding a view made it work.

Thanks!
« Last Edit: June 06, 2013, 08:03:10 pm by Sakurazaki »
こんな私も変われるのならもし変われるのなら白になる

Sakurazaki

  • Newbie
  • *
  • Posts: 31
  • `お嬢様を守ります!
    • MSN Messenger - sakurazaki.setsunita@gmail.com
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #222 on: June 06, 2013, 08:48:18 pm »
Anyone using this lib knows how can I add a light without the central big light?

I want it to emit light as if it was a point but with no central circle.

I tried changing size, intensity and so but didnt change anything.

Thanks!
こんな私も変われるのならもし変われるのなら白になる

lolz123

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #223 on: June 07, 2013, 05:32:39 am »
Try setting the bleed to 0. You can also disable it globally in the LightSystem.
Have you heard about the new Cray super computer?  It’s so fast, it executes an infinite loop in 6 seconds.

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: SFML Light System - Let There Be Light
« Reply #224 on: June 08, 2013, 12:01:17 am »
It's a pity that the development of GLLight2D remains frozen.  :-\  It seemed so promising... At least it would be interesting to update the current library to the last version of SFML. And update the documentacion accordingly! ;D.

In any case I humbly encourage to create/maintain an extension for SFML on illumination.  ::) And yes. I kind of wonder if Nexus ( ;) would consider to add to Thor a module for illumination with outstanding design.  :D A module too big perhaps but too cool too.  8)

DJuego

 

anything