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 - Nutomic

Pages: [1]
1
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 20, 2013, 02:55:13 pm »
I created a Github repository for this project, where I patched it for the latest SFML version and added CMake.

Link

Feel free to open pull requests or issues.

Awww... Still have problems ;)



Does anyone have an idea what to do to get situation from second image instead from first? And situation from third is actual but not satisfactory.

First is when
hull->m_renderLightOverHull = true;

Third is when
hull->m_renderLightOverHull = false;

Of course I can redraw all walls but then I will have all walls visible, also in chambers next to.

I would be very interested in this as well, but I suppose it requires editing the library.

Maybe I'll get around to have a look at the shadow rendering code.

2
Graphics / Simplex Noise Shader not working in SFML
« on: September 15, 2013, 11:35:42 pm »
I am trying to create a shader using simplex noise, based on webgl-noise.

However, the effect doesn't shows some clear patterns in SFML.

Here is how it looks in the project's example:


Here's what it looks like in my SFML project (using the exact same shader):


Here's my SFML code link

And here are the shaders: noisedemo.vert noisedemo.frag

The shaders are exactly the same as in the webgl-noise example.

3
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 12, 2013, 10:17:40 am »
Have you tried turning the bloom off?

That didn't solve it, but now the light/shadows look much more like I want, thanks :D

ConvexHull parameters please ;)

I didn't have any hulls in there yet. Now I just inserted some, and it seems the penumbra effect only works from the moment the light hits a ConvexHull. Obviously a bug, but for now, I can work around it.


4
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 11, 2013, 10:59:48 pm »
Yeah right, I see you mentioned that (I didn't change any color/transparency settings in my code though).

Do you have any idea how I could fix this?

Edit: It definitely has nothing to do with those changes, I reverted them and still have the same problem:


The directional light has the following values:
mPlayerDirectionLight->m_radius = 500.0f;
        mPlayerDirectionLight->m_size = 50.0f;
        mPlayerDirectionLight->m_softSpreadAngle = 0.1f * M_PI;
        mPlayerDirectionLight->m_spreadAngle = 0.5f * M_PI;
        mPlayerDirectionLight->m_intensity = 1.5f;
        mPlayerDirectionLight->m_bleed = 0;
        mPlayerDirectionLight->m_color =  Color3f(1, 0.95, 0.40);

So softspread should work no problem, but it only does sometimes after waiting.

5
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 11, 2013, 10:23:49 pm »
This is perfect, thanks  :D

Another question, why does it sometimes take a few seconds (or more) until fins are loaded on a light? (There are no errors or warnings, and the file path is given correctly).

Edit: Maybe it has to do with me starting outside of a Quadtree (or maybe I am just interpreting DebugDraw wrong).

6
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 11, 2013, 08:48:42 pm »
Edit: Or, can you give some example settings that you used which give good, realistic results?
http://warsztat.gd/screens/2522b9f8e41887617078274713c0d4c2.png
like that?

Minus the halo (which is probably m_bleed?), this would be perfect!

7
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 11, 2013, 07:37:20 pm »
I finally got it working, but even after playing around with Light::m_color and LightSystem::m_ambientColor, colors aren't like I want them:

At the position of the light, anything below it is drawn with a white overlay instead of a transparent one.
Also, I want pitch black if there is no light, instead of gray.

Example pic (single point light at player position):
http://i.imgur.com/oEzrgh1.png
        mLight->m_radius = 250.0f;
        mLight->m_size = 50.0f;
        mLight->m_softSpreadAngle = 0.0f;
        mLight->m_spreadAngle = 2.0f * M_PI;
        mLight->m_intensity = 1.5f;
        mLight->m_bleed = 0;

Edit: Or, can you give some example settings that you used which give good, realistic results?

8
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 06, 2013, 11:55:56 pm »
The thing is, the github version does not have setView, only a public member view.

I would try the version in the op, but gcc doesn't like the absolute include paths.

So I guess I'll try and reach the dev of this version and see if he can help.

9
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 06, 2013, 03:29:58 pm »
Initialization:
        ltbl::LightSystem mLightSystem(qdt::AABB(Vec2f(0, 0), Vec2f(800, 600)), &mWindow);
        // Create a light
        ltbl::Light* mLight = new ltbl::Light();
        mLight->center = Vec2f(200.0f, 200.0f);
        mLight->radius = 500.0f;
        mLight->size = 30.0f;
        mLight->softSpreadAngle = 0.0f;
        mLight->CalculateAABB();

        mLightSystem.AddLight(mLight);

        // Create a hull by loading it from a file
        ltbl::ConvexHull* testHull = new ltbl::ConvexHull();

        testHull->LoadShape("data/testShape.txt");

        // Pre-calculate certain aspects
        testHull->CalculateNormals();
        testHull->GenerateAABB();

        testHull->SetWorldCenter(Vec2f(0, 0));

        mLightSystem.AddConvexHull(testHull);

        // Create a hull by loading it from a file
        ltbl::ConvexHull* testHull2 = new ltbl::ConvexHull();

        testHull2->LoadShape("data/testShape.txt");

        // Pre-calculate certain aspects
        testHull2->CalculateNormals();
        testHull2->GenerateAABB();

        testHull2->SetWorldCenter(Vec2f(300.0f, 300.0f));

        mLightSystem.AddConvexHull(testHull2);

Rendering:
        mWindow.clear();

        mWorldView.setCenter(mPlayer->getPosition());

        // Render world and dynamic stuff.
        mWindow.setView(mWorldView);
        mWindow.draw(mWorld);

        // Update light
        mLight->center.x = mPlayer->getPosition().x;
        mLight->center.y = mPlayer->getPosition().y;
        mLight->UpdateTreeStatus();

        mWindow.setView(mWindow.getDefaultView());
        mLightSystem.view = mWindow.getDefaultView();
         mLightSystem.RenderLights();
        mLightSystem.RenderLightTexture();

        // Render GUI.
        mWindow.drawGUI();
        mWindow.draw(mCrosshair);

        mWindow.display();

As I said, I just took the example and copied it in there.

10
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 05, 2013, 11:29:17 pm »
I think your code look like that
app.draw(smth);
lightSystem.renderLights();
lightSystem.renderLightTexture();
but it have to look like this
app.setView(view);
app.draw(smth);
app.setView(app.getDefaultView());
lightSystem.setView(app.getdefaultView());
lightSystem.renderLights();
lightSystem.renderLightTexture();

That's exactly how my current code looks (I basically copied the example into my project), but doing this only makes the light texture that is shown completely black (the previous code shows light correctly).

11
SFML projects / Re: SFML Light System - Let There Be Light
« on: September 04, 2013, 11:34:27 pm »
I tried to integrate the ltbl version from https://github.com/hovatterz/light into my project, but I'm unable to really get it working.

No matter what I do, the area where shadows are is always the same size, and always in the same position (see attachment).

Does anyone know what I have to do to resize/move this area?

Pages: [1]
anything