What is the difference between OpenGL and XRender in KDE Desktop Effects?

OpenGL and XRender are both drawing APIs that allow for applications of certain geometrical transformations while doing so.

OpenGL is targeted at drawing operations to be executed by a dedicated graphics processing unit (GPU) and provides many features that make generating a 3D-looking image very easy (depth buffer, depth testing, 4×4 homogenous transformation matrices). But you can do 2D looking graphics as well with OpenGL.

XRender is an extension to the X11, to support methods of rendering (antialiasing, alpha blending) that are not possible to do with the core X11 drawing functions. The XRender-API is optimized for 2D looking graphics, though (no depth buffer/test, 3×3 transformation matrices).

Note that XRender is not perfectly orthogonal to OpenGL. Epecially if you need antialiasing in OpenGL you have to use a few functions from XRender to enable it.

What's the use case of each option?

The option of XRender is there to support systems for which there is no proper OpenGL support (lack of stable drivers), but acceptable support for XRender operations. Also XRender is a bit easier to setup (from a programmers point of view) than OpenGL.

In general OpenGL is more flexible than XRender from a programmers perspective. If you're asking which of each you should choose: Start with OpenGL and if everything works acceptable stick with it. The XRender option is a fallback if OpenGL doesn't work properly (however since nowadays in the drivers XRender shares a large part with OpenGL, or is actually implemented using OpenGL it makes no practical difference any more).


I use XRender because KWin with OpenGL likes to spin the CPU for no good reason.

It also has some weird issues with OBS and games running in wine/Proton.

Can highly recommend to switch to XRender on nVidia cards!

Tags:

Linux

Opengl

Kde