3 posts / 0 new
Last post
ponyrider0
ponyrider0's picture
Member
Offline
Last seen: 1 month 1 day ago
Joined: 07/22/2016 - 05:01
Karma: 922
[REL/WIP] FarNifAutoGen v0.15

Sorry, I meant to post this last week, but I got distracted by another project...

Description:
This tool is a set of python scripts which will automatically generate VWD (_far.nif) files using user-configurable settings like model-size threshold, vertex decimation amount, texture reduction amount.  You can specify multiple input sources such as the Oblivion Data folder, individual BSA files, or extracted mod folders.  It reads in a NIF_list file to use for analyzing a pool of potential NIF files for autogeneration.  This NIF_list file can be generated from an ESM/ESP with an included TES4Edit script + python post-TES4Edit cleaner script.

From the README:

FarNifAutoGen v0.15
2019-April-11

Changes:
(v0.15)
Added custom autogen thresholds and reduction factors for flora and terrain
models. This allows us to increase performance while minimizing impact to
graphical quality.

(v0.12)
Re-enabled Blender polyreduction and tweaked multiprocessing to save some
autogeneration time. However, Blender polyreduction still adds a large chunk
to the total script runtime: an additional 30-40 minutes. Bugfix related to
null source-textures in NIFs crashing jobpool worker threads.

(v0.11)
Added BSA auto-reading/extraction support for NIF and DDS files. All BSA
files in the input_datadir will now be searched for needed NIF and DDS files.
Multiple datasources (BSA and/or loose files) can now be specified in the
data_source_list.txt file.  This file also acts as a priority/override list,
so that top entries will take priority or override lower entries. All entries
in list will take priority over automatically detected BSAs in the
input_datadir. Multithreading support for BSA extraction of NIF and DDS files.

(v0.10)
Added checks to skip or workaround unsupported NIF types.  Added
exclusions_list to skip specific input files from autogen process. Moved
alpha-property insertion from root node to TriShape and TriStrips blocks;
this now allows compatibility with Vurt's Trees and other NIF models that
use alpha-channel textures (previously caused blocky textures on leaves).

(v0.05)
Added user configurable nif_joblist variable.  Made definitive fix for
poor quality DXT1 textures containing unused alpha-channels; these
were evident by lowres textures containing large splotches of black.
Added support for NIFs with TriStrips data instead of TriShape; this
allows buildings in Balmora to be included in the autogen.

(v0.02)
Multiprocessing support added for generating FAR.NIF files. Lowres DDS
generation step optimized for batch image processing of all items at
once. User-configurable options added for setting quality/detail of VWDs.
These updates have resulted in massive perfomance improvement:
Morroblivion now converts with default settings in 5 minutes instead of
1.5 hours!

Requirements:
Download GIMP, Blender, PyFFI, NifTools and DDS plugin from this link: 
https://www.patreon.com/posts/modexporter-2018-18765309

You can install everything to their default folders, but you will
Administrator privileges to install some files in C:\Program Files\, etc.
If you run into problems with permissions, try installing into the C:\ root,
ex: C:\Blender, C:\GIMP, C:\Python, etc.

Usage:
The included "nif_list_morroblivion.job" file is a pre-generated list of NIF
files used in the exterior worldspace of Morroblivion.  When you run the .bat
file discussed below, it will read through all the NIFs in the nif_list file
and determine which ones should be used to generate FAR.NIFs.  The script also
keeps track of all the used texture files and generates a corresponding set
of lowres DDS files to be used with the FAR.NIFs.  Additional job files are
included for vanilla Oblivion (nif_list_oblivion.job), a small test list
which generates VWD for Vivec City (nif_list_test_vivec_only.job), and a list
for generating replacement files for only the _far.NIF files included in the
Morroblivion v064 BSA (nif_list_morroblivion_bsa_replacer.job).

Edit the "Start FarNifAutoGen.bat" and make sure that the executables are set to
the correct file path.  Also make sure that the input and output data folders are
set to where you want them by editing the FARNIFAUTOGEN_INPUT_DATADIR and
FARNIFAUTOGEN_OUTPUT_DATADIR lines.  The NIF_JOBLIST_FILE line will allow you to
set which of the pregenerated job lists to use for autogeneration of VWDs.  Make
sure that the double-quotes go around the entire line (see examples in the bat
file).  Use "REM " to comment out any line you don't want to use (it stands for
"remark").

The .bat file also contains user-configurable settings:

NIF_REDUCTION_SCALE is how much to polyreduce the FAR.NIF meshes; 1.00 is 100%
of the original detail, 0.90 would be 90% of the original, etc.
DDS_REDUCTION_SCALE is how much to reduce the lowres DDS files; 1.00 is 100% of
the original resolution, 0.5 is 50% reduction in the X-Y dimentions.
MODEL_RADIUS_THRESHOLD is the minimum size cutoff for selecting which static
meshes will be used to generate FAR.NIFs.  Only models that have a radius larger
than this threshold will be used.

Texture memory is often the limiting factor for latency and FPS, so my
recommendation is to use 90-100% mesh detail and 25% texture detail. Going
below 90% mesh detail will result in noticeable decimation artifiacts like holes
in buildings.  Radius size of 400 will select most of the medium sized buildings
and larger static tree models.  Setting radius threshold smaller than 400 will
probably produce noticeable performance hit, since you'll start including hundreds
of small trees, shrubs and rocks.

If everything is set, double-click "Start FarNifAutoGen.bat" or run it from
the command line.  It will generate all output into the output folder that
is configured in the .bat file.  Once it completes, zip up the "Data" folder
contents in the output folder, then install that as a new mod with your
favorite mod manager.  Once installed with a mod-manager, use TES4LODGen
to get the Oblivion engine to recognize the new VWD objects.

Download: FarNifAutoGen-v015.7z (mediafire link)
 

Edited by: ponyrider0 on 04/17/2019 - 14:25
Puddles
Puddles's picture
Moderator
Offline
Last seen: 3 days 15 hours ago
Joined: 11/17/2016 - 14:09
Karma: 259
Once I get Oblivion setup

Once I get Oblivion setup again on my computer I'll definitely give this a go, very awesome!

ponyrider0
ponyrider0's picture
Member
Offline
Last seen: 1 month 1 day ago
Joined: 07/22/2016 - 05:01
Karma: 922
FYI, I already have a working

FYI, I already have a working version with integrated multi-threaded, python-based ProgressiveMesh Decimation.  However, I'm already working on a newer version that leverages my analysis of RAEVWD and why it runs so (relatively) fast.

https://www.patreon.com/posts/developer-2019-26426678