You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the render_to_surface function would respect a transparent base_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 the ColorTargetState in the BlitPipeline, but that's set for the Renderer and the background color is set in the RenderParams which is passed at each invocation of render_to_surface.
This also demonstrates that Renderer should perhaps be two different types, with a SurfaceRendener wrapping Renderer and storing the BlitPipeline and TargetTexture 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:
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: