Status: Public Beta Version: 0.1.0-alpha01 Last Updated: 2025-10-06
Materia now features a fully functional WebGPU/Vulkan rendering backend that automatically selects the optimal graphics API based on platform and device capabilities. This beta release includes:
| Platform | Backend | Status | Min Requirements | |----------|---------|--------|------------------| | Web | WebGPU | ✅ Beta | Chrome 128+, Safari TP | | Desktop (Windows) | Vulkan 1.3 | ✅ Beta | Vulkan 1.3 drivers | | Desktop (Linux) | Vulkan 1.3 | ✅ Beta | Vulkan 1.3 drivers | | Desktop (macOS) | MoltenVK | ✅ Beta | macOS 14+, MoltenVK 1.2+ | | Android | Vulkan 1.3 | ✅ Beta | API 33+, Vulkan 1.3 | | iOS | MoltenVK | ✅ Beta | iOS 17+, A15/M1+ chip |
Materia is optimized for integrated GPUs and meets constitutional performance requirements:
| Feature | WebGPU | Vulkan | Notes | |---------|--------|--------|-------| | Compute Shaders | ✅ Supported | ✅ Supported | Full parity | | Ray Tracing | ⚠️ Limited | ✅ Supported | WebGPU: experimental, Vulkan: VK_KHR_ray_tracing | | XR Surfaces | ✅ Supported | ✅ Supported | WebXR (web), ARKit/ARCore (mobile) | | PBR Shading | ✅ Supported | ✅ Supported | Full parity | | Omni Shadows | ✅ Supported | ✅ Supported | Full parity |
import io.materia.renderer.*
import io.materia.renderer.backend.*
// Create renderer with automatic backend selection
val rendererFactory = createRendererFactory()
val result = rendererFactory.createRenderer(
RendererConfig(
antialias = true,
powerPreference = PowerPreference.HIGH_PERFORMANCE
)
)
when (result) {
is RendererResult.Success -> {
val renderer = result.value
// Backend automatically selected and initialized
println("Renderer ready with backend: ${renderer.capabilities}")
}
is RendererResult.Error -> {
// Fail-fast error with actionable details
println("Backend initialization failed: ${result.exception.message}")
}
}
The backend initialization process:
val integration = BackendIntegration(config)
val initResult = integration.initializeBackend(surface)
when (initResult) {
is BackendInitializationResult.Success -> {
println("Backend: ${initResult.backendHandle.backendId}")
println("Init time: ${initResult.initializationStats.initTimeMs}ms")
println("Parity score: ${initResult.parityReport.parityScore}")
}
is BackendInitializationResult.Denied -> {
println("Backend denied: ${initResult.message}")
println("Device: ${initResult.report.deviceId}")
initResult.report.limitations.forEach {
println(" - $it")
}
}
is BackendInitializationResult.InitializationFailed -> {
println("Initialization failed: ${initResult.message}")
}
}
Materia enforces these performance requirements:
val perfMonitor = createPerformanceMonitor()
// Track initialization
perfMonitor.beginInitializationTrace(BackendId.VULKAN)
// ... initialize backend ...
val stats = perfMonitor.endInitializationTrace(BackendId.VULKAN)
println("Init time: ${stats.initTimeMs}ms (budget: ${stats.budgetMs}ms)")
println("Within budget: ${stats.withinBudget}")
// Track frame performance
perfMonitor.recordFrameMetrics(
FrameMetrics(
backendId = BackendId.VULKAN,
frameTimeMs = 16.7,
gpuTimeMs = 12.0,
cpuTimeMs = 4.7
)
)
// Evaluate budget over rolling window
val assessment = perfMonitor.evaluateBudget()
println("Avg FPS: ${assessment.avgFps}")
println("Min FPS: ${assessment.minFps}")
println("Meets requirements: ${assessment.meetsRequirements()}")
{
"eventId": "evt-1728230400-1234",
"eventType": "INITIALIZED",
"backendId": "VULKAN",
"device": {
"vendorId": "0x8086",
"productId": "0x9a49"
},
"driverVersion": "30.0.101.1191",
"osBuild": "Windows 11 22H2",
"featureFlags": {
"COMPUTE": "SUPPORTED",
"RAY_TRACING": "EMULATED",
"XR_SURFACE": "SUPPORTED"
},
"performance": {
"initMs": 2450,
"avgFps": 62.1,
"minFps": 31.5
},
"sessionId": "a1b2c3d4...",
"timestamp": "2025-10-06T12:30:45Z"
}
Cause: GPU doesn't support compute shaders, ray tracing, or XR surfaces Solution: Ensure drivers are up to date. Check minimum requirements in platform matrix.
Cause: Backend initialization exceeded 3-second budget Solution: Check GPU driver stability. Review telemetry for performance bottlenecks.
Cause: Performance below 60 FPS target or 30 FPS minimum Solution: Reduce scene complexity, enable LOD systems, check GPU utilization.
Enable debug telemetry for verbose logging:
val config = RendererConfig(debug = true)
Note: This is a beta release. APIs may change before stable 1.0 release.