alandtse / alandtse/imgui-vr-helper

Feature Request: Curved Cylinder Projection for HUDMode

未关闭
#3 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
0
派生
2
平均合并
1 天 18 小时
30 天内合并 PR
11

描述

# Feature Request: Curved Cylinder Projection for HUDMode to Prevent Lens Clipping and Maximize Usable Space

## Background
Currently, `imgui-vr-helper` composites `kClientFlag_HUDMode` overlays as a flat 3D quad in head space (`InSceneOverlay.cpp` / `ComputeHUDQuad`). While this is simple to render, it introduces two limitations in VR:
1. **Circle-in-a-Square Loss**: Because VR lenses are circular/oval, fitting a flat rectangular ImGui viewport inside the circular field of view requires shrinking the quad significantly to prevent its corners from being clipped by the physical lens edges. This discards roughly ~36% of the headset's horizontal field of view.
2. **Perspective Distortion**: The left and right edges of a flat panel are physically further from the player's eyes than the center, causing perspective compression/stretching that makes text harder to read in the periphery.

## Proposal
Implement a curved **cylinder projection** (projecting the HUD texture onto a horizontal arc wrapped around the player's head) as an option or default for `HUDMode`.

### Key Benefits:
1. **No Lens Clipping**: The horizontal curvature matches the natural shape of the headset lenses, allowing the HUD to span a wider field of view without losing the corners to the lens mask.
2. **Uniform Focal Distance**: Every point along the horizontal axis of the HUD remains at the exact same distance from the player's eyes, resolving perspective stretching.
3. **Wider Layouts**: Mods can make full use of horizontal space for wrapping wide subtitle lists, combat stats, or debug graphs into the player's peripheral vision.

### Implementation Considerations:
* **Geometry**: Instead of drawing a single flat 2D quad (2 triangles), the helper would draw a tessellated grid (e.g., a curved mesh of 16-32 horizontal segments) bent along a cylinder of radius `hudDepth`.
* **Disparity & Stereo Convergence**: To keep stereo fusion comfortable, the helper should still project the cylindrical coordinates eye-independently using the raw projection tangents (`GetProjectionRaw`).
* **API Impact**: Expose a new setting (e.g. `hudCurvature` or `hudShape = "cylinder"`) in `ImGuiVRHelper.toml`.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start in InSceneOverlay.cpp at ComputeHUDQuad to understand how HUDMode currently creates its flat head-space quad. Then inspect the ImGuiVRHelper.toml setting path and the projection handling around GetProjectionRaw; the work is done when HUDMode supports the agreed cylinder option or default with comfortable stereo projection and wider usable HUD space.

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
ar-vr-xr, computer-graphics
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。