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

Pages: 1 2 3 [4] 5 6 ... 20
46
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 27, 2016, 08:13:12 am »
Where is that extra 0.1% of time coming from? (They keep adding up to 100.1%)
I guess its up to some rounding issue.

I reran the profiling analysis for few edges and many lights:
(click to show/hide)
Does this mean that there is no bottleneck in this case?

47
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 05:48:30 pm »
Ok, makes sense :) But to be honest, I'm unsure how I could optimize the algorithmic approach.. maybe using some additional culling to determine which edges are really hit by a light's ray... 8)

48
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 04:35:44 pm »
For sure ;)
Ok but why? The code is:
sf::Vector2f getFarPoint(sf::Vector2f const& origin, sf::Vector2f const & pos, sf::FloatRect const& box) {
        // calculate normalized direction
        auto direction = pos - origin;
        auto norm = std::sqrt(direction.x * direction.x + direction.y * direction.y);
        direction /= norm;
        // calculate suitable distance
        auto dist = box.width * box.height;
        // create far point
        return pos + dist * direction;
}
I'd assume the calculation of the square root as most expensive .. floating point division could be expensive, too ... could. I don't know how to optimize at this point? Any ideas? :)

49
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 04:23:56 pm »
You can subdivide big functions into several smaller ones if you want to get more detailed profiler results.

This gives me (with less aggressive optimization):
(click to show/hide)

So to say: getFarPoint() is my bottleneck?

50
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 04:08:18 pm »
Profiling an optimized build results doesn't give me a hint neither :S
(click to show/hide)

/EDIT: Less aggressive optimization ... ok could be "getFarPoint" ... but ... well ... ^^
(click to show/hide)

51
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 02:54:22 pm »
Do you run a debug or an optimized build of your application? It's strange that sf::Vector2 operators take so much time. They should even be inlined in optimized builds, an not appear at all in the profiler's output.
I was using
g++ -o main main.cpp lighting.cpp -I./ -lsfml-system -lsfml-window -lsfml-graphics -std=c++11 -g -pg
 
for building, so it's a typical debug one I think.

52
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 02:40:18 pm »
First, you should let the profiler run for more than 30 ms (typically a few seconds minimum). The longer it runs, the more samples it collects, and the more accurate it is.

Then there's nothing more complicated than what you've read: the 3 first entries take all the time, at equal part.

I re-ran it with lots of edges and lights (for ~30s, because of the low framerate) and for few edges and lights (for 6-7s).

lots of edges and lights
(click to show/hide)

few edges and lights
(click to show/hide)

Based on those results I can only come to the conclusion, that the update() method is the bottleneck (lol, cpt. obvious xD). How to go more into detail?

53
Graphics / Re: Performance on Drawing Lightened Scene
« on: May 25, 2016, 01:14:28 pm »
Use a profiler.
Good point! Unfortunately I don't have much experience reading profiler output :S

I added some of the top lines from the output to the spoiler btw. I just understand that the Vector::operator- and my getFarPoint() and update() use most of the time. :-[ What should I be able to read from this?

(click to show/hide)

54
Graphics / Performance on Drawing Lightened Scene
« on: May 25, 2016, 12:35:15 pm »
Hi, I'm aware of the existence of LTBL ^^
Atm I'm working on the overall performance of my RPG - its current bottleneck is my lighting implementation. That's why I cut it out to a minimal example. The code can be found on https://github.com/cgloeckner/sfml-lighting-test

On my laptop (Intel i7, GeForce GT 540M using NVIDIA binary driver 352.63 @ Ubuntu wily - btw other drivers cause major problems) the example code runs with
  • ~90 FPS for 20 Edges + 1 Light
  • ~80 FPS for 100 Edges + 1 Light
  • ~30 FPS for 100 Edges + 5 Lights
  • ~10 FPS for 1000 Edges + 5 Lights
I guess this is an issue related to my implementation. Got anybody an idea how I can find the bottleneck?

About the code: I seperated "light", "shadow" and "fog" layers because of my rendering order:
  • floor tiles
  • light layer (might colorize the floor)
  • objects (so they are not colorized by the lights)
  • shadow layer (hides objects behind obstacles
  • wall tiles (if I render those before the shadows, no walls will be visible)
  • fog layer (hides walls that are far away from light sources)
Maybe there even are ways to improve this :)

Thanks in advance!! :)

55
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 24, 2016, 05:04:44 pm »
Today, I also added some simple menu animations

56
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 24, 2016, 12:03:13 pm »
Meanwhile, not just terrain can cause shadows... now, also movable objects can!

http://www.youtube.com/watch?v=Fnyq4CPviAc

57
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 21, 2016, 07:59:17 am »
I quite like the music and I personally prefer the non-chiptune style of this piece.
As people most do :D

To embed YouTube videos, just remove the "s" from https.
Thanks!

58
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 20, 2016, 04:32:03 pm »
Today, I'd like to preset some piece of music I wrote for becoming the "dungeon theme" of the game. The composition is still in progress, but I'm not sure which style of interpretation fits the visuals the most: Classical or chiptune style.

http://www.youtube.com/watch?v=OG88cP3-ed4

What's your oppinion?

PS: I still suck at embedding videos ^^

59
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 19, 2016, 02:37:39 pm »
I attached a screenshot of the current alpha menu's "Lobby screen". It's minimal but powerful ;) Stay tuned!

60
SFML projects / Re: Rage - a coop dungeon crawler
« on: May 19, 2016, 08:51:17 am »
I just nailed  the pending milestones for the playable alpha demo:
  • Game UI: This is the current milestone. This includes game menus (settings, title screen) as well as the game's hud (health bar, levelup-popups etc.)
  • Enhanced Randomization: Including a Room editor and more beautiful corridors
  • Enemies (like in the last list)
  • Powerup system: Items won't be completly implemented, so killed enemies will drop health boni etc.
  • Enhanced Code quality: Pure internal stuff (further unit testing and code documentation)
  • Initial Audio implementation: Sound effects for attacking, some basic background ambience sounds etc.

Some other features like enhanced animations or an implementation of blocking enemies' attacks will be delayed to another version. This way I try to make sure that the demo will actual be available ... some day :D

Pages: 1 2 3 [4] 5 6 ... 20
anything