Ultralight icon indicating copy to clipboard operation
Ultralight copied to clipboard

OpenGL texture render output is flipped

Open Dschadu opened this issue 2 years ago • 1 comments

OpenGL assumes (0, 0) to be bottom left, but Ultralight renders the texture with (0, 0) as top left. This results in a flipped texture. The Sample7 shows this: In Sample.cpp from Line 280-287 the quad that is being created is the wrong way around to fix this issue. The only way for me to fix this is to flip the buffer manually before writing the texture, which is inefficient. Furthermore, since Ultralight only renders areas that have been changed, I'm forced to use config.force_repaint = true; to prevent the image from flipping every frame (like when an animated button is used).

I'm developing an OpenVR overlay and OpenVR takes an OpenGL texture. There is no the option to flip it again without causing other issues: Flipping the OpenVR viewports results in inverted coordinates for click-detection.

Is there an option to change this? If not, please add an option to change this behavior.

Dschadu avatar Nov 21 '21 13:11 Dschadu

If you don't care about efficiency: use a temporary framebuffer+RT and render to it a flipped texture.

SupinePandora43 avatar Jul 03 '22 13:07 SupinePandora43