This project is read-only.

Is it only me? (performance issue)

Feb 1, 2011 at 5:11 PM
Edited Feb 1, 2011 at 5:12 PM

But it seems that the latest changeset (2584) performs worse than the 2464... at least the light moves a lot smoother in the older changeset.


Edit: Sorry, my mistake. Ther latest changeset's testbed contains a higher number of lights. That's why it seems to perform worse.

Feb 1, 2011 at 5:58 PM

Not a problem. Pnikosis. Regarding future performance enhancements, Xixonia is currently working on an update that will drastically improve the speed and allow you to add even more lights to the screen. But as always, please let us know if any new problems are introduced by changesets. Thanks!


Feb 1, 2011 at 8:27 PM
Edited Feb 1, 2011 at 8:33 PM

I'm using an nvidia 8800 GT

Feb 1, 2011 at 10:32 PM
Edited Feb 1, 2011 at 10:34 PM

These are a lot of lights xixonia (and blurred, which I suppose uses more resources), the 41 below is the framerate I guess. The low framerate I had was on my workplace's computer anyway, which probably doesn't have a very good videocard :)

BTW: I don't know if I said this before, but I love you guys for this work.

Feb 1, 2011 at 11:16 PM

Once you're satisfied with the speed increase, spread the word. We intend to make Krypton the fastest, best looking 2D light engine out there. :)

Feb 2, 2011 at 7:56 AM

Is there a performance cost of moving lights over stationary ones? 

I'll eventually craft some sort of light on/ light off function depending on whether it's within range of the transformation matrix... unless that's something you're planning as well?

Krypton's looking great in my engine, really excited by it; looking forward to plugging in the latest changeset and tinkering with shadow colours, next :)

Feb 2, 2011 at 9:11 AM

This is the most ghetto code I've ever come up with, but I think it works? lol...

        public Matrix Matrix
            get { return this.mWVP; }
                if (this.mWVP != value)
                    this.mWVP = value;

                    // This is totally ghetto, but it works for now. :)
                    var inverse = Matrix.Invert(value);

                    var v1 = Vector2.Transform(new Vector2(1, 1), inverse);
                    var v2 = Vector2.Transform(new Vector2(1, -1), inverse);
                    var v3 = Vector2.Transform(new Vector2(-1, -1), inverse);
                    var v4 = Vector2.Transform(new Vector2(-1, 1), inverse);

                    this.mBounds.Min = v1;
                    this.mBounds.Min = Vector2.Min(this.mBounds.Min, v2);
                    this.mBounds.Min = Vector2.Min(this.mBounds.Min, v3);
                    this.mBounds.Min = Vector2.Min(this.mBounds.Min, v4);

                    this.mBounds.Max = v1;
                    this.mBounds.Max = Vector2.Max(this.mBounds.Max, v2);
                    this.mBounds.Max = Vector2.Max(this.mBounds.Max, v3);
                    this.mBounds.Max = Vector2.Max(this.mBounds.Max, v4);
Feb 2, 2011 at 9:30 AM


The idea is to create a fast 2D light engine focused on parallax scrollers. As a result, we'll definitely be culling based on what can be in the view at any given time. I'm currently working out the details (quad-tree?, etc).

Feb 2, 2011 at 5:41 PM

These latest changes are amazing; been tinkering with hull alpha levels and blurring, and it's making such a huge difference to the visuals.

Lovely work chaps, keep it up :)

Feb 3, 2011 at 12:24 AM

I wouldn't get too used to the colored shadows though... The new changes I'm working on increase Krypton's performance dramatically, but I haven't incorporated the colored shadow yet... I'm not entirely sure it's possibly with the fast shader, either... O.o

Alpha transparency on the shadows though is still entirely possible, however. 

Feb 3, 2011 at 1:44 PM

I'm not using the coloured shadows, just the alpha. Hope that stays, because it's brillo.

Feb 5, 2011 at 10:39 AM

Having trouble coming up with a nice solution for the alpha transparent shadows. I'm currently using the alpha channel to precompute the light texture alpha, but I was trying to do it without adding more than one additional draw call.

Right now, it looks like there's going to be a total of 2 draw calls per light when not using alpha transparents shadows, and 4 draw calls when using alpha transparent shadows (3, if you just want the light to have ambiance.


going to bed... sigh.

Feb 6, 2011 at 11:56 AM

Well, it's completely worth the trade-off, as far as I'm concerned- it makes the whole thing feel much more realistic, rather than occluding all light. :)