SecondHalfGames / yakui

yakui is a declarative Rust UI library for games
Apache License 2.0
222 stars 18 forks source link

Support Distorted UI #102

Open LPGhatguy opened 10 months ago

LPGhatguy commented 10 months ago

Some games have slightly distorted UI for their HUD, sometimes moving a bit to match the player's camera movement and simulate a 3D effect:

Cyberpunk-207712292020-014148-80978

While we have plans for per-layer transforms for 3D-looking panels, it might be additionally useful to support distortion that applies at the fragment level. We'd also want to make sure input lines up with the distorted UI as well so that the mouse doesn't feel offset.

Ralith commented 8 months ago

I think this could be implemented satisfyingly outside of yakui, by projecting yakui's 2D domain (e.g. mapping onto a curved mesh) and inverse-projecting mouse input (e.g. raycasting) however the user likes.