BorrowedTorch.Ormh
1.0.0
Prefix Reserved
dotnet add package BorrowedTorch.Ormh --version 1.0.0
NuGet\Install-Package BorrowedTorch.Ormh -Version 1.0.0
<PackageReference Include="BorrowedTorch.Ormh" Version="1.0.0" />
<PackageVersion Include="BorrowedTorch.Ormh" Version="1.0.0" />
<PackageReference Include="BorrowedTorch.Ormh" />
paket add BorrowedTorch.Ormh --version 1.0.0
#r "nuget: BorrowedTorch.Ormh, 1.0.0"
#:package BorrowedTorch.Ormh@1.0.0
#addin nuget:?package=BorrowedTorch.Ormh&version=1.0.0
#tool nuget:?package=BorrowedTorch.Ormh&version=1.0.0
BorrowedTorch.Ormh
Packs the four single-channel maps of a PBR material into one RGBA texture: R = ambient occlusion, G = roughness, B = metallic, A = height. Four textures become one, a shader reads three values with one fetch, and a parallax march reads height from the channel block compression keeps finest (DXT5 stores alpha on its own).
This package is the format and the packing, with no dependencies: it knows nothing about MonoGame or any image format. You hand it decoded pixels; it hands back packed ones. To build packed maps as part of a MonoGame content build, use BorrowedTorch.ContentPipeline, which is built on this package and packs exactly the same bytes.
What you get:
- The
.ormhdescriptor: a small JSON file naming where each channel comes from - an image, one channel of an image (optionally inverted), or a constant. - The packer: one call from a layout and an image loader to the packed image. Sources of different sizes are resampled to the largest the way a GPU magnifies them, so a 256 x 256 height map next to 2048 x 2048 maps looks the same packed as it did bound on its own.
- Descriptors written back: a layout serializes to descriptor text again, sources as absolute paths, for building a copy of a descriptor somewhere else.
Requirements
- .NET 8 or later. No other dependencies.
Installing
dotnet add package BorrowedTorch.Ormh
Concepts
| Type | What it is |
|---|---|
OrmhLayout |
Where each of the four channels comes from. Read from a descriptor, or built in code. |
OrmhChannelSource |
One channel: a channel of an image, maybe inverted, or a constant. |
OrmhPacker |
Packs a layout into one image, decoding sources through the loader you pass it. |
OrmhImage |
8-bit RGBA pixels, rows top to bottom, straight alpha. In and out of the packer. |
Everything is in the BorrowedTorch.Ormh namespace.
The descriptor
// Rock/ORMH.ormh - paths are relative to this file
{
"ao": "Rock_AO.png",
"roughness": { "source": "Rock_Gloss.png", "invert": true },
"metallic": 0,
"height": { "source": "Rock_Height.png", "channel": "r" }
}
Each of the four channels is one of:
| Form | Meaning |
|---|---|
"Map.png" |
The image's red channel. |
{ "source": "Map.png", "channel": "g", "invert": true } |
Any of r, g, b, a; invert stores 255 minus it. |
0.5 |
A constant from 0 to 1 over the whole map. |
All four are required - roughness and metallic have no value that means "absent", so a channel left out is more likely
a slip than a choice. Comments and trailing commas are allowed. Anything wrong with a descriptor, malformed JSON
included, comes back as a FormatException with a message that says what to write instead.
Packing
using BorrowedTorch.Ormh;
var layout = OrmhLayout.Load("Textures/Rock/ORMH.ormh");
// Decode the sources however your tool already does: the packer only wants 8-bit RGBA.
OrmhImage packed = OrmhPacker.Pack(layout, path => MyDecoder.LoadRgba(path));
// packed.Rgba is Width x Height x 4 bytes: R = AO, G = roughness, B = metallic, A = height.
Or without a descriptor:
var layout = new OrmhLayout(
ao: new OrmhChannelSource { SourcePath = "maps/Rock_AO.png" },
roughness: new OrmhChannelSource { SourcePath = "maps/Rock_Gloss.png", Invert = true },
metallic: new OrmhChannelSource { Constant = 0 },
height: new OrmhChannelSource { SourcePath = "maps/Rock_Height.png" });
Paths in a layout built in code are handed to your loader as they are; each distinct path is asked for once, however many channels read it.
Using a packed map
Alpha holds height, not coverage. Whatever builds the texture must leave it straight: premultiplying alpha scales the other three channels by height, and a colour key zeroes whole texels.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BorrowedTorch.Ormh:
| Package | Downloads |
|---|---|
|
BorrowedTorch.Engine
Kindling, Borrowed Torch's game engine: what a game's own code builds against - its features registering components, systems, keys and UI handlers - for the Kindling editor and player to run |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 164 | 10/29/2026 |