-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering to a surface and transparency #549
Comments
This would also impact using xilem in the current form if you have other content behind the UI (like a 3D application or game). |
I've been playing with integrating xilem rendering with the rest of my rendering pipeline. What I'm finding is that, as you suggest, render_to_surface isn't that useful outside of vello only rendering. Instead I'm using render_to_texture and after making a couple things in vello public (BlitPipeline and TextureTarget) and adding a couple tweaks (blend mode added to the blit pipeline being key) it integrates pretty cleanly with a standard wgpu pipeline, either as a new render pass or embedded within another render pass. |
It would be nice if the
render_to_surface
function would respect a transparentbase_color
and then show whatever is already rendered to the surface.The main issue here is that
BlendState::ALPHA_BLENDING
would need to be set in theColorTargetState
in theBlitPipeline
, but that's set for theRenderer
and the background color is set in theRenderParams
which is passed at each invocation ofrender_to_surface
.This also demonstrates that
Renderer
should perhaps be two different types, with aSurfaceRendener
wrappingRenderer
and storing theBlitPipeline
andTargetTexture
members, since they aren't used when rendering to a texture.There are other issues with the current code, like if you're rendering to multiple surfaces and they're different sizes, then you'd be constantly creating and re-creating the
TargetTexture
.Alternatively, maybe the
render_to_surface
should just be somewhere else and not part of the core library ...The text was updated successfully, but these errors were encountered: