rafalh / dashfaction

A community patch for the Red Faction (2001) FPS game
https://www.factionfiles.com/ff.php?action=file&id=6252
Mozilla Public License 2.0
61 stars 11 forks source link

Scale geomod crater texture PPM based on its resolution #293

Open GooberRF opened 1 month ago

GooberRF commented 1 month ago

This PR adjusts the pixels per metre (PPM) value applied to geomod craters at creation such that it scales based on the resolution of the crater texture. Base game behaviour is to use a static PPM value of 32.0.

This is beneficial because custom geomod textures (either via HD texture mods or configuration by level author in Level Properties) will now display correctly. Stock game behaviour stretches them out if their resolution is >256. The new behaviour in this PR scales them based on the game's established standard of 32 PPM at 256px resolution. As a result, this PR has no effect whatsoever unless you either have a clientside mod that replaces rock02.tga or you load a map configured to not use the default geomod crater texture.

Resolves #69

Here are some screenshots showing the behaviour with this PR:

256x256 crater texture (default) 20241020_004241_glass_house

512x512 crater texture 20241020_004159_glass_house

8192x8192 crater texture 20241020_004040_glass_house