# Cortex Engine AI-Native 3D game engine with pure P/Invoke Vulkan 1.3 render backend. ![Cortex Engine Demo](cortex_demo.gif) ## Features - **Vulkan 1.3** — dynamic rendering, synchronization2, pure P/Invoke (no wrapper libraries) - **PBR Shading** — Cook-Torrance BRDF, ACES tonemapping, multi-light support - **Cubemap Array Shadows** — omnidirectional shadows from multiple point lights, 16-tap Poisson disk PCF - **Jolt Physics** — rigid body dynamics, box/sphere colliders, gravity - **ImGui** — debug overlay, light/shadow/physics controls - **AI/MCP** — 7 tools (spawn, transform, material, delete, list, world state, screenshot) via HTTP/SSE - **Video Recording** — FFmpeg pipe, 60 FPS capture, 30 FPS output - **ECS** — Flecs.NET with Transform, Mesh, Material, Light, Camera, RigidBody components - **SDL3 Window** — cross-platform, Vulkan surface ## Quick Start — Linux (main platform) ```bash # Build dotnet build CORTEX_ENGINE.sln -c Debug # Run ./scripts/run.sh # Run the alternative Solar Sanctuary demo scene ./scripts/run.sh -- --scene sanctuary # Run the playable Arena Strike FPS demo ./scripts/run.sh -- --scene shooter # Run with AI/MCP server ./scripts/run.sh -- --mcp-port 5000 # Run tests dotnet test tests/Engine.Tests/Engine.Tests.csproj -c Debug ``` ## Quick Start — Windows x64 PowerShell scripts select the Windows native runtime assets explicitly; Bash is not required: ```powershell # Build and restore Windows native dependencies dotnet restore .\CORTEX_ENGINE.sln -r win-x64 dotnet build .\CORTEX_ENGINE.sln -c Debug -r win-x64 --no-restore # Run the engine .\scripts\run.ps1 # Run a demo scene .\scripts\run.ps1 --scene shooter # Run with AI/MCP server .\scripts\start_mcp_engine.ps1 -Port 5000 # Run tests dotnet test .\tests\Engine.Tests\Engine.Tests.csproj -c Debug -r win-x64 ``` The project keeps Linux as the default RID on Linux hosts and selects `win-x64` automatically on Windows. Use `-r win-x64` when cross-publishing from another OS. ## Controls - **WASD** — move camera - **Right-click + drag** — look around - **Q/E** — down/up - **Shift** — speed boost - **ESC** — quit ## ImGui Panels - **Cortex Engine Debug** — FPS, camera, entity count, physics toggle, reset scene - **Shadow & Light Parameters** — per-light intensity/range/RGB, shadow bias/radius/farplane, ambient RGB - **Video Recording** — start/stop recording to MP4 ## Demo Scenes - **Kinetic Gallery** (default) — sphere pyramid, diamond rain, orbiting torus rings and physics. - **Solar Sanctuary** (`--scene sanctuary`) — a luminous torus-knot core, three orbital rings, an obelisk circle and falling physical comets. - **Arena Strike** (`--scene shooter`) — a playable FPS arena with hitscan targets, attacking drones, health, score, waves and reloadable ammunition. Use **LMB** to fire and **R** to reload. ### Arena Strike Gameplay *Pure scene render — UI intentionally hidden.* ![Arena Strike FPS demo](arena_strike_demo.gif) ### Arena Strike UI ![Arena Strike HUD and debug controls](arena_strike_ui.png) ## MCP Tools Connect via `http://localhost:5000/` (SSE): | Tool | Description | |---|---| | `spawn_model` | Create object (cube/sphere, optional physics) | | `set_transform` | Move/rotate/scale by name | | `set_material` | Change color/roughness/metallic | | `delete_entity` | Remove object | | `list_entities` | List all objects | | `get_world_state` | Full JSON state | | `capture_screenshot` | Request screenshot | ## Requirements - .NET 9 SDK - Vulkan 1.3+ drivers - SDL3 (bundled via NuGet) - FFmpeg (for video recording) - glslangValidator (for shader recompilation) ## Architecture See [CORTEX_ENGINE_ARCHITECTURE.md](CORTEX_ENGINE_ARCHITECTURE.md) for full technical docs. ## License All rights reserved.