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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - polkom21

Pages: [1]
1
SFML projects / Re: SFML Light System - Let There Be Light
« on: January 15, 2014, 11:13:30 pm »
Hi everybody.

I come back to writing my game and I have next problem with lights. Why penumbra isn't rendered as it should be?

And next problem. Why when I set m_renderLightOverHull on false  shadow looks like:


2
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 27, 2013, 11:55:01 pm »
Ok. I repaired it. How to change position convexHull?

3
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 21, 2013, 05:46:20 pm »
Thanks for the idea. I have another problem. When I set light point position like static position all it's ok how I set position from object position light isn't rendered.

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: December 18, 2013, 11:23:45 pm »
Hello everybody!

I have problem with y-axis because I want flip this axis and I don't know how to do it. Help me!

EDIT:
Ok. I know how to do it. Now I have a problem with rotation ConvexHull. Whether is something function who sets angle?

5
SFML projects / Re: SFML Light System - Let There Be Light
« on: November 11, 2013, 10:13:28 pm »
All source files are added to mingw folder so I use <>

6
SFML projects / Re: SFML Light System - Let There Be Light
« on: November 11, 2013, 09:55:40 pm »
I include all source to my project who are needed

#include <LTBL/Light/LightSystem.h>
#include <LTBL/Light/Light_Point.h>
#include <LTBL/Utils.h>
#include <assert.h>
#include <SFML/Graphics.hpp>
int main(int argc, char* args[])
{
    sf::VideoMode vidMode;
    vidMode.width = 800;
    vidMode.height = 600;
    vidMode.bitsPerPixel = 32;
    assert(vidMode.isValid());
    sf::RenderWindow win;
    win.create(vidMode, "Let there be Light - Demo");
    // ---------------------- Background Image ---------------------
    sf::Texture backgroundImage;
    assert(backgroundImage.loadFromFile("data/background.png"));
    // Tiling background
    backgroundImage.setRepeated(true);
    sf::Sprite backgroundSprite(backgroundImage);
    backgroundSprite.setTextureRect(sf::IntRect(0, 0, vidMode.width, vidMode.height));
    // --------------------- Light System Setup ---------------------
    ltbl::LightSystem ls(AABB(Vec2f(0.0f, 0.0f), Vec2f(static_cast<float>(vidMode.width), static_cast<float>(vidMode.height))), &win, "data/lightFin.png", "data/shaders/lightAttenuationShader.frag");
    // Create a light
    /*ltbl::Light* testLight = new ltbl::Light();
    testLight->m_center = Vec2f(200.0f, 200.0f);
    testLight->m_radius = 500.0f;
    testLight->m_size = 30.0f;
    //testLight->m_spreadAngle = 2.0f * static_cast<float>(M_PI);
    //testLight->m_softSpreadAngle = 0.0f;
    testLight->CalculateAABB();*/

    ltbl::Light_Point * testLight = new ltbl::Light_Point();
    ls.AddLight(testLight);
    // Create a hull by loading it from a file
    ltbl::ConvexHull* testHull = new ltbl::ConvexHull();
    if(!testHull->LoadShape("data/testShape.txt"))
    abort();
    // Pre-calculate certain aspects
    testHull->CalculateNormals();
    testHull->CalculateAABB();
    testHull->SetWorldCenter(Vec2f(300.0f, 300.0f));
    ls.AddConvexHull(testHull);
    // ------------------------- Game Loop --------------------------
    sf::Event eventStructure;
    bool quit = false;
    while(!quit)
    {
        while(win.pollEvent(eventStructure))
            if(eventStructure.type == sf::Event::Closed)
            {
                quit = true;
                break;
            }
        sf::Vector2i mousePos = sf::Mouse::getPosition(win);
        // Update light
        testLight->SetCenter(Vec2f(static_cast<float>(mousePos.x), static_cast<float>(vidMode.height - mousePos.y)));
        win.clear();
        // Draw the background
        win.draw(backgroundSprite);

        ls.RenderLights();
        ls.RenderLightTexture();

        win.display();
    }
    win.close();
}
 

7
SFML projects / Re: SFML Light System - Let There Be Light
« on: November 11, 2013, 08:57:51 pm »
Hi everyone!

I'm writing to you because I have problem with LTBL. So when I compiling my project with example I have error's:
Code: [Select]
obj\Debug\main.o||In function `main':|
gmail.com\ltbl\main.cpp|23|undefined reference to `Vec2f::Vec2f(float, float)'|
gmail.com\ltbl\main.cpp|23|undefined reference to `Vec2f::Vec2f(float, float)'|
gmail.com\ltbl\main.cpp|23|undefined reference to `AABB::AABB(Vec2f const&, Vec2f const&)'|
gmail.com\ltbl\main.cpp|23|undefined reference to `ltbl::LightSystem::LightSystem(AABB const&, sf::RenderWindow*, std::string const&, std::string const&)'|
gmail.com\ltbl\main.cpp|23|undefined reference to `ltbl::LightSystem::~LightSystem()'|
gmail.com\ltbl\main.cpp|32|undefined reference to `ltbl::Light_Point::Light_Point()'|
gmail.com\ltbl\main.cpp|23|undefined reference to `ltbl::LightSystem::~LightSystem()'|
gmail.com\ltbl\main.cpp|33|undefined reference to `ltbl::LightSystem::AddLight(ltbl::Light*)'|
gmail.com\ltbl\main.cpp|35|undefined reference to `ltbl::ConvexHull::ConvexHull()'|
gmail.com\ltbl\main.cpp|36|undefined reference to `ltbl::ConvexHull::LoadShape(char const*)'|
gmail.com\ltbl\main.cpp|39|undefined reference to `ltbl::ConvexHull::CalculateNormals()'|
gmail.com\ltbl\main.cpp|40|undefined reference to `ltbl::ConvexHull::CalculateAABB()'|
gmail.com\ltbl\main.cpp|41|undefined reference to `Vec2f::Vec2f(float, float)'|
gmail.com\ltbl\main.cpp|41|undefined reference to `ltbl::ConvexHull::SetWorldCenter(Vec2f const&)'|
gmail.com\ltbl\main.cpp|42|undefined reference to `ltbl::LightSystem::AddConvexHull(ltbl::ConvexHull*)'|
gmail.com\ltbl\main.cpp|56|undefined reference to `Vec2f::Vec2f(float, float)'|
gmail.com\ltbl\main.cpp|56|undefined reference to `ltbl::Light::SetCenter(Vec2f)'|
gmail.com\ltbl\main.cpp|61|undefined reference to `ltbl::LightSystem::RenderLights()'|
gmail.com\ltbl\main.cpp|62|undefined reference to `ltbl::LightSystem::RenderLightTexture()'|
gmail.com\ltbl\main.cpp|66|undefined reference to `ltbl::LightSystem::~LightSystem()'|
gmail.com\ltbl\main.cpp|66|undefined reference to `ltbl::LightSystem::~LightSystem()'|
What I have to do to LTBL work in my project?

Pages: [1]
anything