Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixing 3D text rendering #364
Fixes rendering of 3D text when not fullscreen or buildboard.
Instead of just calculating one world view projection matrix at the start of the string, I calculate a world view projection matrix for each glyph. This isn't needed in 2D rendering, so it should check somewhere if it is 3D text or not for performance reasons. There are probably other better ways to go about this, but this fixes the function problem in hopes of a better production solution.
I also have to set RealVirtualResolutionRatio to (1f, 1f), or else scaling is all messed up in 3D. I'm sure this value is useful in 2D somewhere, though, so again -- it needs to know when it is rendering in 3D (so it can just set this Vector2 to (1f, 1f) or in 2D and calculate it).
Motivation and Context
3D text simply doesn't work in Xenko currently. VR UIs would be impossible without a fix like this.
Types of changes
OK, I think this is "cleaned up" & does some checking to see if it is rendering in 3D or 2D. I made viewProjectionMatrix public within UIBatch to be quicker to access for calculating world view matrices for each glyph. Hoping this is ready for merging, or at least very close.
In other news, I really think the blinking cursor is an existing bug unrelated to my work -- but easily overlooked or worked around by making the "edit text" field no higher than a single line of the font. Although, multi-line edit text fields won't work...