• entries
    633
  • comments
    4,501
  • views
    675,180

Beta update available

Sign in to follow this  
Josh

274 views

An update is available on the beta branch on Steam. This only updates the compiled executables for Lua, only on Windows.

Optimization

I've rewritten the way lights and objects affect each other. In the old mobile renderer it was necessary to store a list of lights that affect each entity, because it was using a forward renderer and had to send the information for the nearest four lights to the object's shader to calculate lighting. This was a complicated task and is not needed with a deferred renderer.

 

The C++ PlayAnimation routine had a bug that would cause the animation to keep updating invisibly, causing shadows to continue rendering when they did not need to be. This is fixed.

 

I also fixed some inefficiency that would affect point and spot lights, even if their shadows were not being updated.

 

Finally, I set it so that in medium and low quality lighting modes, only one shadow will be updated per frame, unless the player is close to the shadow volume. This allows you to have many lights updating but only one gets their shadowmap redrawn each frame. This can cause some small visual glitches but the high quality setting (World:SetLightQuality(2)) can be used to always render everything.

 

Performance Benchmarks (4.3 beta vs 4.1/4.2)

  • One more Day: 15% faster
  • A Demon's Game: 17% faster
  • The Garden: 20% faster
  • Vectronic: 23% faster
  • AI and Events map: 200% faster

 

This build should be considered unstable. It will crash on some games.

  • Upvote 13
Sign in to follow this  


31 Comments




Recommended Comments

I don't know what "frame limit" is in your description above.

 

A measured framerate slightly different from 60 can be attributed to rounding error. Your computer's timer only measures milliseconds, and at 60 hertz each frame takes 16.667 milliseconds to render, so the measured framerate will be slightly off.

 

Everything you are describing so far sounds like normal behavior. The game will run smoothly at 60 FPS with VSync on, and run faster but with a variable framerate with VSync off.

 

If you want to artificially limit the framerate at some value above 60, or if you want a constant 60 hz without VSync, then you can just add a delay command in your loop like this:

local t = Time::Millisecs()
if lastrendertime~=nil then
   local elapsed = t - lastrendertime
   if elapsed<17 then
       Time:Delay(17 - elapsed)
   end
end
lastrendertime = t

Share this comment


Link to comment

Sometimes in Vsync, my framerate caps to 30 randomly. It's not a Leadwerks thing, as I experienced it in older Source Engine games too. Been like that since I got my 750.

 

I'll try this artificial syncing too...

 

But overall, 4.3 is turning out to be one of my favorite updates so far. Ogg support and perf improvements is what I've been waiting for the longest. smile.png

Share this comment


Link to comment

I spent hours trying to find a bug which crashed my game after it was done loading a level. Turns out it was this last beta update. On the bright side I did find a couple of bugs.

Share this comment


Link to comment

I'm experimenting a bit with the timing. It's difficult because there's not really a good solution that meets everyone's needs.

  • Upvote 1

Share this comment


Link to comment

Tumira, I experienced frame jerks on similar hardware setup. In my case, I noticed that with VSync ON, one of the 8 processor cores still uses near 100% (while others at 0%).

I solved the problem by setting DISABLE "Multithread Optimization" in Nvidia control panel. Now, when VSync is enabled, at 60 fps every core is utilized near 0% (well, maybe bit more), and single-threaded OpenGL apps like Leadwerks runs far smoother, without any jerking.

I hope this helps maybe in your case too.

Share this comment


Link to comment

@Lupin. Thank you for your suggestions and tips. I did try to change the Thread-optimisation in Nvidia control panel from auto to off and even on, it still the same jerkiness and stuttering and hitching. The frame limiting in 4.3 beta solves the problem for me.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Create Your Account

Sign in

Already have an account? Sign in here.

Sign In Now