Feature Gallery
Every image on this page is rendered headless by examples/gallery.php in the php-vio repository – no window, no manual retouching. The script doubles as a smoke test of each feature path on a real backend:
bash
php -d extension=vio examples/gallery.php # auto backend, all scenes → docs/gallery/
php -d extension=vio examples/gallery.php d3d11 # pick a backend
php -d extension=vio examples/gallery.php opengl out/ shadow_map,hdr_tonemapThe scenes below were captured on Direct3D 12; the same script produces the same pictures on the other backends. The ray tracing scenes need a GPU and are skipped where the feature is missing.
2D
![]() | |
Shapes – vio_rect, vio_rounded_rect, vio_circle, vio_line; one z-sorted batch, one draw call. Guide | Sprites & text – vio_sprite + vio_text with HarfBuzz shaping (Arabic RTL, Thai clusters) and max_width word wrap. Guide |
3D pipeline
![]() | ![]() |
Meshes, shaders, pipelines – vio_mesh / vio_shader / vio_pipeline / vio_draw; GLSL → SPIR-V → HLSL/MSL/GLSL. Guide | Instancing – vio_draw_instanced, 400 cubes with per-instance mat4 in a single draw. Guide |
![]() | ![]() |
Sampler states – filter × wrap grid (VIO_FILTER_*, VIO_WRAP_*). API | Anisotropic filtering – ['anisotropy' => 16] (right) vs. trilinear (left) on a grazing-angle plane. API |
![]() | |
Volume texture – vio_texture_3d ray-marched through sampler3D. API |
Render targets
![]() | ![]() |
Post-processing – scene into vio_render_target, second pass samples it as a texture. Guide | Shadow mapping – ['depth_only' => true] target, PCF lookup with a comparison sampler. Guide |
![]() | ![]() |
Multiple render targets – 'attachments' => [RGBA8, RGBA16F, R16F], one pass writes albedo / normals / depth. | MSAA – ['samples' => 4] render target, resolved on unbind (D3D11, OpenGL, Metal). |
![]() | ![]() |
Cube render target – six faces via vio_bind_render_target($ctx, $rt, $face), vio_generate_mipmaps, textureLod by roughness. API | HDR – ['hdr' => true] RGBA16F target, ACES tone map in the resolve pass. |
Compute
![]() | ![]() |
Storage image – compute shader writes an image2D (['storage' => true]), the render pass samples it. | Vertex-stage storage buffer – compute writes instance matrices, the vertex shader reads them via gl_InstanceIndex; no readback. API |
Geometry & tessellation stages
![]() | ![]() |
Geometry shader – vio_shader(['geometry' => …]): single vertices drawn as VIO_POINTS, the geometry stage emits a sprite quad per point. Guide | Tessellation – tess_control + tess_eval on VIO_PATCHES ('patch_vertices' => 4): the evaluation stage displaces quad patches; level 2 (left) vs 18 (right). Guide |
Ray tracing
![]() | ![]() |
Ray query – vio_acceleration_structure() and rayQueryEXT: one shadow ray per pixel from the fragment shader. | Opacity micromaps – vio_opacity_micromap_bake() turns an alpha texture into micro-triangle states, read back with rays. Unknown states still run the any-hit shader. |
Backend coverage
| Scene | OpenGL | D3D11 | D3D12 | Metal | Vulkan |
|---|---|---|---|---|---|
| 2D shapes / sprites / text | ✅ | ✅ | ✅ | ✅ | ✅ |
| 3D meshes, instancing, samplers, anisotropy, 3D texture | ✅ | ✅ | ✅ | ✅ | ✅ |
| Post-process, shadow map, MRT, cube RT, HDR | ✅ | ✅ | ✅ | ✅ | ✅ |
| MSAA render target | ✅ | ✅ | ✅ | ✅ | ✅ |
| Compute storage image, vertex storage | ✅ (GL ≥ 4.3) | ✅ | ✅ | ✅ | ✅ |
| Geometry shader, tessellation | ✅ (GL ≥ 3.2 / 4.0) | ✅ | ✅ | ✅ (emulated with compute kernels) | ✅ |
| Ray query shadows | – | – | ✅ | not run | ✅ |
| Opacity micromaps | – | – | ✅ | – | ✅ |
Query vio_supports_feature() before relying on a path.
The gallery covers rendering paths. Upscaling, draw bundles, mesh shaders, multiview and the desktop APIs (windows, menus, dialogs, tray) have no scene yet.

















