Jump to content

Dev Blog 1/31/2019 - Rendering Optimizations & Texture Packing


jcsnider

Recommended Posts

984549685492.png

Rendering Optimizations & Texture Packing

Jan. 31st 2019

 

 

Client Rendering Optimizations

This is really hard to explain, but we've made some massive performance updates to the rendering system in Beta 6.

 

We no longer cache each map into 9 massive background images. 

(Lower/Middle/Upper layers * 3 Autotile frames)

 

Multiplying 9 massive images by 9 on-screen maps = 81 massive images.

Those no longer eat up valuable video ram.

 

The historical alternative for these engines was to draw every tile individually.

While that requires far less ram you kill your fps by telling your graphic card to draw up to 5k tiles every frame for every map. 

 

Now we're using a new method. We generate a set of triangles and vertices which are used to draw our map and ask the graphic card to remember those.

Going forward when we want to draw the map we tell the graphic card to use it's remembered instructions and we gain massive fps by not sending the full set of instructions each frame.

 

TLDR; Lower vRam usage, quicker map loading, higher fps, and other optimizations!

 

 

 

Texture Packing

When rendering graphics in a video game you can 'batch' draw calls. If you draw several consecutive sprites/objects/animations/ui elements/etc from the same texture all of those drawing commands can be combined and sent to the graphic card at one time.  The fewer batches that get sent the higher your fps.

 

Texture packing increases performance by combining lots of your small textures into just a few larger ones. 

 

There is a button in the Beta 6 editor that will do all of the texture packing for you:

f4a88f8d6a7ba2ae33585f22e9684554.png

 

 

922838ededc2ca8a516a109af452346c.gif

 

Click here for an example of what a packed texture looks like.

 

Texture packing is completely optional, and the client will utilize packed textures if they are found in the resources folder.

 

 

 

The Bottom Line

Let's talk stats, what do these changes mean in practice?  We should see roughly the same or better fps across the board. Laptops with integrated graphics won't see a huge difference while gaming rigs with decent graphic cards might see fps gains in the hundreds.  As far a memory usage goes you should see a sharp decline all across the board, and the client will feel better when traversing map boundaries because there won't be a big stutter when map caching previously occurred.

 

Here are some of the basic performance tests that I did using my laptop with integrated graphics and my gaming rig.

6a9e2a52ebf704201cba99c62e24acb8.png

 

 

5399ee9a0a1b81ba0457e63aebe7c57a.png

This shows fps, higher is better. My gaming rig saw huge gains, laptop only climbed about 30fps.

 

 

2daf778c35e654838c0d9ec2b8aa63ca.png

This is gpu memory usage in megabytes, lower is better. Beta 6 brings huge drops across the board :). 

 

 

These updates will be live with the Beta 6 launch! Stay tuned!

Link to comment
Share on other sites

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!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...