November 3, 2013

RomTerraria 3.0 Feature #1: Large Resolution Fixes


The most common complaint about RomTerraria lately has been that since Terraria 1.2 was released, Eyefinity/nVidia Surround support breaks down when either horizontal or vertical resolution goes above 2048 pixels when using default lighting.

The reason? They moved to a render-to-texture system and fixed the maximum render-to-texture size at 2048x2048.

Well, with RomTerraria 3.0, you'll have access to resolutions up to 8192x8192 4096x4096.

Here's how it will work.  The code is split into three chunks.  Two chunks will ship as an accompanying .NET assembly, RTHooks.dll.  The third chunk is actually rewritten into the Terraria executable.

Lines 54-56 change the maximum resolution from 1920x1080 to 8192x8192 4096x4096.

Lines 60-75 wire up calls to RTHooks inside Terraria.Main.Initialize(), similar to what I did with a subclass back with RomTerraria 1 and 2, but without requiring a subclass.  These two hooks set the game to run at the current desktop resolution and enable cooperative full screen rendering.

Lines 78-87 walk through Terraria.Main.InitTargets() and finds the constants there.  There are only a couple of constants, and they all are tied to calculating the size of the render targets.  This boosts them up to 8192x8192 4096x4096.

Currently looking at a November 5 7 release.  Just needs more testing.

[Update 11/6] Screenshots!  Thanks, Steve!


[Update #2 11/6] Sorry, but due to an XNA 4.0 limitation on the maximum size of a render target, you will be limited to 4096x4096.

2 comments:

Des Lambert said...

Oh happy days - fellow multi-monitor user here...cant wait to see your work my friend :)

Brandon Fletcher said...

3840x800 user here, looking forward to it