#include <shadow_path_geometry.h>
Public Member Functions | |
| constexpr | ShadowVertices () |
| constexpr | ShadowVertices (std::vector< Point > vertices, std::vector< uint16_t > indices, std::vector< Scalar > gaussians) |
| size_t | GetVertexCount () const |
| size_t | GetIndexCount () const |
| The count of the indices that define the mesh. | |
| const std::vector< Point > & | GetVertices () const |
| const std::vector< uint16_t > & | GetIndices () const |
| const std::vector< Scalar > & | GetGaussians () const |
| bool | IsEmpty () const |
| std::optional< Rect > | GetBounds () const |
| GeometryResult | GetPositionBuffer (const ContentContext &renderer, const Entity &entity, RenderPass &pass) const |
Static Public Member Functions | |
| static std::shared_ptr< ShadowVertices > | Make (std::vector< Point > vertices, std::vector< uint16_t > indices, std::vector< Scalar > gaussians) |
Static Public Attributes | |
| static const std::shared_ptr< ShadowVertices > | kEmpty |
A class to hold a vertex mesh for rendering shadows. The vertices are each associated with a gaussian coefficent that represents where that vertex lives in the shadow from a value of 1.0 (at the edge of or fully in the darkest part of the umbra) to 0.0 at the edge of or fully outside the penumbra).
The vertices are also associated with a vector of indices that assemble them into a mesh that covers the full umbra and penumbra of the shape.
The mesh is usually intended to be rendered at device (pixel) resolution.
Definition at line 24 of file shadow_path_geometry.h.
|
inlineconstexpr |
Definition at line 35 of file shadow_path_geometry.h.
|
inlineconstexpr |
Definition at line 37 of file shadow_path_geometry.h.
| std::optional< Rect > impeller::ShadowVertices::GetBounds | ( | ) | const |
Definition at line 1385 of file shadow_path_geometry.cc.
References impeller::TRect< Scalar >::MakePointBounds().
|
inline |
Definition at line 54 of file shadow_path_geometry.h.
|
inline |
The count of the indices that define the mesh.
Definition at line 50 of file shadow_path_geometry.h.
Referenced by GetPositionBuffer().
|
inline |
Definition at line 53 of file shadow_path_geometry.h.
Referenced by GetPositionBuffer().
| GeometryResult impeller::ShadowVertices::GetPositionBuffer | ( | const ContentContext & | renderer, |
| const Entity & | entity, | ||
| RenderPass & | pass | ||
| ) | const |
Definition at line 1415 of file shadow_path_geometry.cc.
References data, impeller::HostBuffer::Emplace(), GetIndexCount(), GetIndices(), impeller::Entity::GetShaderTransform(), impeller::ContentContext::GetTransientsDataBuffer(), impeller::ContentContext::GetTransientsIndexesBuffer(), GetVertexCount(), i, impeller::k16bit, impeller::kTriangle, and impeller::GeometryResult::type.
|
inline |
The count of the unique (duplicates minimized) vertices in the mesh. This number is also the count of gaussian coefficients in the mesh since the two are assigned 1:1.
Definition at line 47 of file shadow_path_geometry.h.
Referenced by GetPositionBuffer().
|
inline |
Definition at line 52 of file shadow_path_geometry.h.
|
inline |
True if and only if there was no shadow for the shape and therefore no mesh to generate.
Definition at line 58 of file shadow_path_geometry.h.
|
inlinestatic |
Definition at line 28 of file shadow_path_geometry.h.
|
static |
Definition at line 26 of file shadow_path_geometry.h.