Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

n337speak

Uploaded by

n337speak

Virus scan

Safe to use

Tags for this mod

About this mod

PowerShell & ImageMagick based script to generate parallax maps from normal maps.

Requirements
Permissions and credits
Changelogs
If, like me, you are looking for an easy way to produce passable parallax maps for a texture set that doesn't currently have them, you might be in the right place.

I hashed out the basic version of the script with help from ChatGPT, then tuned the values myself in game until they made something I considered acceptable. In the hopes that it may be useful to others, I'm providing it here.

Before I continue please note that this is by definition a hack job, and I do not recommend either:

  • wildly attempting to parallax map your entire load order
  • flooding the nexus with patches for well loved texture sets

The best solution for parallax mapping is for authors to bake the maps themselves, but for people like me chasing 'good enough,' there's this. I consider this a resource - for personal use, do anything you like with it, and if a texture set maintainer considers the results usable, a word of thanks is appreciated and that's it.

Requirements:

  • PowerShell
  • ImageMagick standalone installed and on your PATH, as DemongelRex helpfully clarifies:

    Make sure to add to windows PATH variable (Environment Variables), and don't have any spaces in the directory name.


The script is below:
# Loop through all normal maps matching the pattern "*_n.dds"
Get-ChildItem *_n.dds | ForEach-Object {
    $normalMapPath = $_.FullName
    $heightMapPath = $normalMapPath -ireplace "_n.dds$", "_p.dds"

    # Run the ImageMagick command to convert the normal map to a grayscale height map,
    # adjust brightness, reduce resolution, and apply a Gaussian blur
    & magick convert $normalMapPath -colorspace RGB -separate -delete 0,2 -average `
        -brightness-contrast 40x10 -resize 50% -blur 0x8 `
        $heightMapPath
}

# The brightness, contrast, and blur values were tuned by n337speak until the script output 'usable' textures. Adjust to your preference based on the results you're getting.


I'll also be uploading it to the files section obviously. Just run it in a folder with the textures. If you have parallax meshes already you're good after that. And obviously it will overwrite any existing parallax maps, so if you want to preserve them back them up.

The images have some example outputs taken in game. Comparison isn't perfect, but you can see ENB off/on for my preset and get an idea what the effect looks like.

When testing and tuning the script I used farmhouse textures by clevercharff and recommend that you check out their work. (Note that the stone wall has parallax mapping already and I don't claim my generated version is better, at all, but you can compare it for reference on how the script performs if you like, IDK)

Edits should be straightforward. If, for instance, you don't want the size reduction, remove '-resize 50%' and you're done.