Mibo.MonoGame 2.0.0-rc-002

This is a prerelease version of Mibo.MonoGame.
dotnet add package Mibo.MonoGame --version 2.0.0-rc-002
                    
NuGet\Install-Package Mibo.MonoGame -Version 2.0.0-rc-002
                    
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="Mibo.MonoGame" Version="2.0.0-rc-002" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mibo.MonoGame" Version="2.0.0-rc-002" />
                    
Directory.Packages.props
<PackageReference Include="Mibo.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 Mibo.MonoGame --version 2.0.0-rc-002
                    
#r "nuget: Mibo.MonoGame, 2.0.0-rc-002"
                    
#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 Mibo.MonoGame@2.0.0-rc-002
                    
#: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=Mibo.MonoGame&version=2.0.0-rc-002&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Mibo.MonoGame&version=2.0.0-rc-002&prerelease
                    
Install as a Cake Tool

Mibo

Install the templates:

dotnet new install Mibo.Templates
dotnet new mibo-2d -o MyGame
cd MyGame
dotnet run

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.

Following that spirit, Mibo keeps it lean, just F# and the Elmish loop with a handful of commodities to get out of your way and let you enjoy the craft.

Mibo is an Elmish-based F# game framework with two interchangeable backends — raylib-cs and MonoGame (DesktopGL/OpenGL and WindowsDX/DirectX) — designed to allow developers to write games using familiar MVU patterns for all kinds of game genres and sizes.

Mibo aims to solve 80/20 of use cases for enabling developers to focus on game logic rather than boilerplate code, providing guidelines and architecture for structuring game code, handling input, rendering, asset management, and time management among others.

What's in the box?

  • Elmish runtime (MVU loop) with Cmd, Sub, optional fixed timestep, and frame-bounded dispatch
  • Input — raw input (Keyboard, Mouse) + semantic mapping via InputMap / ActionState
  • Assets — texture, font, sound, and model loading caches
  • Rendering — Command buffer based rendering:
    • 2D batch renderer with layers and multi-camera support
    • 3D batch renderer with opaque/transparent passes and custom shader switching
    • Escape hatches for custom GPU work
  • Camera helpers with screen-to-world, orbit, and ray casting
  • Layout — 2D procedural grid layout (CellGrid2D) with platformer, top-down, and geometric primitives
  • Layout3D — 3D voxel-style grid layout (CellGrid3D) with terrain, interior rooms, corridors, stairs, and procedural generation
  • Animation — sprite sheet slicing, AnimatedSprite state machines, and grid-based animation definitions
  • Input Mapper — Listen to raw input and map it to semantic actions

Getting started

Prerequisites:

  • .NET SDK 8 or later
  • A working OpenGL setup
dotnet --version
dotnet tool restore
dotnet restore
dotnet build
dotnet test

To build the docs site locally:

dotnet tool restore
dotnet fsdocs build
# or for live editing:
dotnet fsdocs watch

Samples

The samples developed for the initial Raylib version and the new MonoGame Samples are being stored in its own repository Mibo.Samples is the place to visit.

You'll find examples of

2D::

  • Platformer - A simple platformer featuring lights, normal maps, occluders and particles
    • Sample Mibo.Raylib targeting Desktop OpenGL
    • Sample Mibo.MonoGame targeting Windows Desktop DirectX11
  • Space Battle - A minimalistic hex grid strategy game a'la Wargroove or Advanced Wars
    • Sample Mibo.Raylib targeting Desktop OpenGL
  • Ping Pong - A Small client-server example
    • Mibo.Raylib Client
    • Mibo.MonoGame Client
    • dotnet app acting as a server running Mibo.Core's headless support

3D:

  • Platformer - A simple platformer with 3D models, lights, shadows, particles, and skeletal animation
    • Mibo.Raylib targeting Desktop OpenGL

License

Mibo is distributed under the zlib/libpng License.

Built on

Mibo is built on top of:

  • raylib — the cross-platform graphics library that powers the raylib backend's rendering, input, and audio layers
  • raylib-cs — the C# bindings that make raylib accessible from .NET
  • MonoGame — the cross-platform framework that powers the MonoGame backend (DesktopGL/OpenGL and WindowsDX/DirectX)

Feedback

Issues and PRs are very welcome. If you're interested in using F# for game development beyond simple 2D games, Mibo aims to be a practical, batteries-included framework that scales with your ambition.

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
2.0.0-rc-002 0 7/7/2026
2.0.0-rc-001 42 7/2/2026

### Added

- **3D:** model-aware post-processing — `Draw3D.postProcessWithDepth` exposes camera-POV scene depth to post-process passes (fog, depth-of-field, SSAO). The depth texture stores non-linear NDC z (`[0,1]`, 0=near, 1=far); linearize with the camera's near/far. raylib renders the scene into a custom framebuffer with a sampleable depth-texture attachment (no extra geometry pass); MonoGame re-renders opaque geometry into a dedicated R32F target. Use plain `Draw3D.postProcess` for color-only effects so the depth-production cost is skipped. See `docs/graphics3d/overview.md` → "Post-processing" and `docs/shaders.md` → "Post-process shaders" for the depth-texture contract and shader binding requirements.
- **3D:** instanced draws inside a `beginEffect`/`endEffect` scope are now shaded by your own shader/effect when it opts into instancing — raylib declares `in mat4 instanceTransform;`, MonoGame exposes an `Instanced` technique. Effects that don't opt in keep the previous PBR-instanced fallback. Skinned + instanced isn't supported (no per-instance bone palette). See the "Instancing (opt-in)" section of `docs/shader-uniforms.md`.
- **MonoGame 2D:** `Draw.setSamplerState` sets the sprite-batch sampler state for subsequent sprites (e.g. `SamplerState.PointClamp`), mirroring `setBlend` — use it to stop tiles sampled from a gutterless spritesheet from bleeding at the edges. It flushes the batch on change and defaults to the previous behavior (`SamplerState.LinearClamp`). On raylib, use the new `Texture.filter` helper instead.
- **Raylib:** a `Texture` helper module lets you configure a loaded texture's sampler in a pipe — `filter`, `wrap`, and `mipmaps` (e.g. `assets.Texture "tiles.png" > Texture.filter TextureFilter.Point`, or `> Texture.wrap TextureWrap.Repeat`). These override the load-time trilinear+mipmaps default (needed for point-filtered tile atlases and repeating backgrounds). MonoGame controls sampling per draw via `Draw.setSamplerState` instead.

### Changed

- **Templates:** the MonoGame 2D and 3D templates now keep the shared library under `src/`, ship the MonoGame content pipeline (`Content/Content.mgcb`, built by each thin client via `MonoGame.Content.Builder.Task`), and expose `create()` as a ready-to-run `MonoGameProgram` with the content root already configured — the thin clients just construct `MiboGame` and run, instead of each wiring up `MonoGameProgram.ofProgram`.

### Fixed

- **3D:** a custom `beginEffect`/`endEffect` shader/effect that opts into shadows now receives them correctly. The scene-upload path bound the shadow atlas under the wrong sampler name on MonoGame (`texture5` instead of `shadowAtlas` — the name `mgfxc` exposes samplers under), never uploaded the per-caster `shadowBiases`, and omitted the bias from the `ShadowResult` bundle entirely. Declare `sampler2D shadowAtlas : register(s5)` (MonoGame) / the `shadowAtlas`/`shadowBiases` uniforms (raylib) to opt in.
- **Docs:** asset access in the program/assets/animation guides pointed at a non-existent `ctx.Assets` member — fixed to `GameContext.getService<IAssets> ctx`. The Core layout APIs (`CellGrid2D`/`LayeredGrid2D`) always take `System.Numerics.Vector2`, which collides with `Microsoft.Xna.Framework.Vector2` in MonoGame projects; the layout and camera guides now flag this and qualify the calls. The `SpriteState` reference now lists every field (`Rotation`/`Origin`/`NormalMap`), not just `Color`/`Layer`.