H073.HxOBJ.MonoGame 1.0.0

Prefix Reserved
dotnet add package H073.HxOBJ.MonoGame --version 1.0.0
                    
NuGet\Install-Package H073.HxOBJ.MonoGame -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="H073.HxOBJ.MonoGame" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="H073.HxOBJ.MonoGame" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="H073.HxOBJ.MonoGame" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add H073.HxOBJ.MonoGame --version 1.0.0
                    
#r "nuget: H073.HxOBJ.MonoGame, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package H073.HxOBJ.MonoGame@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=H073.HxOBJ.MonoGame&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=H073.HxOBJ.MonoGame&version=1.0.0
                    
Install as a Cake Tool

HxOBJ.MonoGame

Load Wavefront OBJ models into MonoGame — with PBR materials, vertex colors, tangent computation, and smoothing group support, powered by ModelKit.

Bridges HxOBJ (pure OBJ/MTL parser) and ModelKit (scene graph).

var scene = FormatRegistry.LoadScene(GraphicsDevice, "building.obj");

Installation

dotnet add package H073.HxOBJ.MonoGame
<PackageReference Include="H073.HxOBJ.MonoGame" Version="1.0.0" />

Pulls in H073.HxOBJ and H073.ModelKit automatically.


Usage

using ModelKit;

// Auto-discovered — just reference the package
var scene = FormatRegistry.LoadScene(GraphicsDevice, "model.obj");

// Async
var scene = await FormatRegistry.LoadSceneAsync(GraphicsDevice, "model.obj");

// With options
var scene = FormatRegistry.LoadScene(GraphicsDevice, "model.obj", new LoadOptions
{
    KeepCpuData = true,
    SkipTextures = false
});

What You Get

A Scene containing:

Data Description
Meshes[] One mesh per material group, GPU vertex/index buffers
Materials[] PBR, Phong, or Unlit based on MTL properties
Nodes[] Flat scene graph (one node per mesh)

Material Mapping

MTL ModelKit
Kd Material.Color
map_Kd Material.Texture
Ke Material.EmissiveFactor
map_Ke Material.EmissiveMap
bump / norm Material.NormalMap
map_Pr / map_Pm Material.MetallicRoughnessMap
Ka Material.AmbientColor
Ks Material.SpecularColor
Ns Material.Shininess
Pr / Pm Material.RoughnessFactor / Material.MetallicFactor
d / Tr Material.AlphaMode (Blend when < 1)

Material Type Detection

MTL has Type
Pr, Pm, map_Pr, map_Pm MaterialType.Pbr
Ks, Ns, or Illum >= 2 MaterialType.Phong
Neither MaterialType.Unlit

Vertex Formats

Data Available Format Stride
Position + Normal VertexPositionNormal 24B
+ UV VertexPositionNormalTexture 32B
+ Vertex Colors VertexPositionNormalTextureColor 36B
+ Normal Map (tangents) VertexPositionNormalTextureTangent 48B

Features

  • Smoothing Groups — Correct hard/soft edge normals
  • Tangent Computation — Auto-computed when material has normal/bump map
  • 16-bit Index Optimization — Uses 16-bit indices when vertex count < 65536
  • Normal Computation — Auto-computed when OBJ has no normals
  • N-gon Triangulation — Fan triangulation for arbitrary polygons

Architecture

model.obj + model.mtl
  |
  v
HxOBJ (pure parser)
  |  ObjReader.Read() -> ObjFile
  v
HxOBJ.MonoGame (bridge)
  |  ObjModelLoader -> vertex dedup + triangulation
  v
ModelKit (scene graph)
     Scene with Mesh[], Material[], SceneNode[]

Limitations

  • No built-in renderer — ModelKit provides data, you provide the rendering
  • No skeleton/animation — OBJ format has no rigging support
  • Flat scene graph — OBJ has no node hierarchy


License

MIT

Contact

Discord: sameplayer

Product 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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 132 3/16/2026