Request for documentation (Rendering) #11955
-
|
I'd like to request for the creation of a documentation page on, https://wiki.hypr.land/Plugins/Development/, "How rendering works", that breaks down how rendering happens in Hyprland. (I don't really understand how rendering works so it would have to be written by someone who does.) As far as I've looked, nearly every plugin that renders something, just cheats and damages the entire screen and requests a new frame. That works, but it's a massive hack and destroys performance. I'd like an explanation of what causes a frame to be rendered. Do clients report damage and then a render pass happens? and things draw themselves if they intersect with the reported damage box? generating IPassElement's, which are then later executed in order and clipped based on the damage box? Are window framebuffer contents cached? Does everything get rendered to layers and then outputted to one framebuffer, or is there only one framebuffer per screen? How does blurring play into this? It's hard to understand how things are rendered right now which makes it difficult to write efficient plugins |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
essentially, yea. If you damage anything, a repaint is scheduled. Damage accumulates until the repaint is carried out. If there hasn't been any change in more than your refresh cycle, the repaint will happen ASAP, otherwise it will happen at the next vblank. "damage" is just wayland slang for "content that has changed and needs to be repainted"
No, we read from the window's buffers directly. Wayland's synchronization model makes this work.
More than one framebuffer per screen, but rendering is per-screen, yes. (e.g. blur fb, off fb for blurring, etc) |
Beta Was this translation helpful? Give feedback.
essentially, yea. If you damage anything, a repaint is scheduled. Damage accumulates until the repaint is carried out. If there hasn't been any change in more than your refresh cycle, the repaint will happen ASAP, otherwise it will happen at the next vblank. "damage" is just wayland slang for "content that has changed and needs to be repainted"
IPassElementis an "operation" that is carried out once the entire scene is "queued". The reason is that the pass can look at those elements and do occlusion ("oh, this will be covered by an opaque thing, dont render it") and blur calculations ("oh this part needs blur so we need to blur be…