9 #include "fml/logging.h"
27 const std::shared_ptr<ShadowVertices>& geometry)
28 : geometry_(geometry) {}
33 const std::shared_ptr<ShadowVertices>& geometry) {
34 return std::make_shared<ShadowVerticesContents>(geometry);
38 const Entity& entity)
const {
39 return geometry_->GetBounds();
43 shadow_color_ = color;
49 using VS = ShadowVerticesVertexShader;
50 using FS = ShadowVerticesFragmentShader;
53 geometry_->GetPositionBuffer(renderer, entity, pass);
66 options.primitive_type = geometry_result.
type;
69 VS::FrameInfo frame_info;
70 FS::FragInfo frag_info;
74 frag_info.shadow_color = shadow_color_.
Premultiply();
77 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
78 VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
80 return pass.
Draw().ok();
PipelineRef GetDrawShadowVerticesPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
Matrix GetShaderTransform(const RenderPass &pass) const
Render passes encode render commands directed as one specific render target into an underlying comman...
virtual bool SetVertexBuffer(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
virtual void SetPipeline(PipelineRef pipeline)
The pipeline to use for this command.
virtual fml::Status Draw()
Record the currently pending command.
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
ShadowVerticesContents(const std::shared_ptr< ShadowVertices > &geometry)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
~ShadowVerticesContents() override
static std::shared_ptr< ShadowVerticesContents > Make(const std::shared_ptr< ShadowVertices > &geometry)
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
void SetColor(Color color) override
LinePipeline::FragmentShader FS
LinePipeline::VertexShader VS
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
constexpr Color Premultiply() const
@ kNormal
The geometry has no overlapping triangles.
VertexBuffer vertex_buffer