• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Improving The Witcher 2's grass/asset pop-in - is it now possible?

EatChildren

Currently polling second in Australia's federal election (first in the Gold Coast), this feral may one day be your Bogan King.
As anybody who has played The Witcher 2: Assassin's of Kings on PC has noticed, the game has fairly aggressive LOD/foliage control, much of which has no known solution. This leads to high quality grass popping up in about a 2m radius around Geralt, and rapid degradation of foliage (and other) assets at a short distance. To the game's credit, the low quality assets are very cleverly implemented (more on that in a minute), but none-the-less do not retail the maximum quality of fully rendered assets.

Currently there is no known solution. Attempts to improve the asset loading had been, until recently, restricted to config file tweaks, and as these variables appeared to be controlled on an engine level the probability of finding a simple ini/cfg tweak were very low.

However, back in May CD Projekt RED released their official The Witcher 2 toolkit: REDkit. REDKit appears to offer similarly deep (and arguably deeper) modding tools than Bethesda's for their sandbox titles, allowing users to create their own worlds, quests, variable tweaks, and custom assets.

I'm personally totally useless at it, and documentation is poor, but after digging around in the files I suspect that maybe, maybe it will finally be possible to improve the LOD issues.

First, the known tweaks. It's actually possible to improve The Witcher 2's base mesh and foliage rendering distance with ini tweaks. There's two variables, and these are their defaults at maximum (via the game's options):

MeshDistanceScale=1.2
FoliageDistanceScale=1.0

And here's how it normally looks:

mesh1w1szo.png


Now, if we change them:

MeshDistanceScale=1000
FoliageDistanceScale=1000

mesh2p1sn9.png


Note the rocks, and distance foliage thickness, as well as the dry weeds rendering further. Same goes for the details (rope) on the tent to the right. Increase the variables, increase the rendering distance.

So why doesn't this fix the asset pop-in? Because, as far as I'm aware, The Witcher 2 uses an aggressive LOD system called "billboard". When you get a certain distance from an asset (usually foliage, and not very far), the game loads in a 2D sprite in its place. Bushes turn to flat green blobs. Rocks turn to flat grey dots. It's easiest to see on the above image by looking at the little pebbles littering the ground. The stones very close to Geralt are polygonal assets. All other stones, starting with that big one on the right side of Geralt are 2D. In fact, almost all those distant bushes are 2D as well. Layered 2D assets that won't pop into 3D models until you're very, very close.

Loading 2D assets in to replace 3D assets at a distance isn't even remotely new. However, the clever thing with this method is that it generates 2D assets based on multiple angles, and stores those image files for reference. So instead of getting one flat 2D object that rotates to face you, you have something like six different 2D images for any one single object, loading the appropriate image based on which angle you're facing. It's a snazzy illusion in motion as it prevents a scene of 2D objects (which is obviously very heavy in this case) always looking the same from every angle.

Now, why am I suspicious that this may finally be fixable? Take a look at the assets when viewed in REDkit (in this case the dry weeds also in the above two scenes):

mesh3whs31.png


You can see numerous variable for the billboard system, including how many sides are rendered, what distance they should render, where the billboard data is saved, and so on. In theory, being able to tweak this data and have The Witcher 2 load in replacement assets (basically identical) that don't load in the billboard model until very, very far away (much like the mesh/foliage tweaks above) should solve the problem.

If it's so easy, why haven't I done it? Because I tried and failed. I know you can easily replace TW2 assets by having a file share the same name as an existing asset, and dragging and dropping it into the CookedPC folder with the right series of directories (that are normally compiled into pak0). TW2 will prioritise the unpacked version and use it instead. People have already done this to retexture characters, weapons, and armour. A fix for the over bright grass colour that the Extended Edition caused works the same way.

I started simple, with the dry grass, by making tweaks and copying the altered files into the CookedPC directory. All I got was the assets disappearing entirely. They don't render at all. My first thought was "well fuck, it's an engine level block", but upon testing with totally unaltered files they still don't render. Or in short, I can copy across any asset with no changes and the game outright refuses the render them, like it's prioritising my copied assets but they're missing something and thus not appearing in the game world. Copy across all the grass, and all the grass disappears.

Either I'm missing some lock in the engine, or doing it wrong. If it's the former, I don't understand why other modders have managed to replace character data with textures, outfits, and other tweaks just fine, meanwhile mine does not work despite doing something similar. If it's the latter, then I maintain that it may be possible to fix the grass/foliage/asset LOD rendering and effectively rendering the full 3D assets over a larger distance.

The question is: how?
 
Top Bottom