|
QmlMaterial 0.1.0
|
High-fidelity shadow rendering based on Skia's analytic shadow model. More...
#include <QRectF>#include <QVector2D>#include <QVector4D>#include <QColor>#include <optional>#include <array>#include "qml_material/scenegraph/geometry.h"Go to the source code of this file.
Functions | |
| scalar | qml_material::sk::AmbientBlurRadius (scalar height) |
| Calculates the blur radius for ambient shadows based on Z-height. | |
| scalar | qml_material::sk::AmbientRecipAlpha (scalar height) |
| Calculates the reciprocal alpha for ambient shadows to adjust intensity. | |
| void | qml_material::sk::GetSpotParams (scalar occluderZ, scalar lightX, scalar lightY, scalar lightZ, scalar lightRadius, scalar *blurRadius, scalar *scale, QVector2D *translate) |
| Calculates spot shadow parameters based on a virtual point light source. | |
| void | qml_material::sk::GetDirectionalParams (scalar occluderZ, scalar lightX, scalar lightY, scalar lightZ, scalar lightRadius, scalar *blurRadius, scalar *scale, QVector2D *translate) |
| Calculates directional shadow parameters (simplified spot model). | |
High-fidelity shadow rendering based on Skia's analytic shadow model.
This module implements a specialized mesh generator for Material Design 3 shadows. Instead of using Gaussian blur (which is expensive and hard to clip), we use:
The mesh consists of 4 corners (6 vertices each) and an optional inner quad for overstroked shadows.
| void qml_material::sk::GetDirectionalParams | ( | scalar | occluderZ, |
| scalar | lightX, | ||
| scalar | lightY, | ||
| scalar | lightZ, | ||
| scalar | lightRadius, | ||
| scalar * | blurRadius, | ||
| scalar * | scale, | ||
| QVector2D * | translate ) |
Calculates directional shadow parameters (simplified spot model).
Calculates directional shadow parameters. This is a simplified version of the spot model where the light source is assumed to be at infinity.
| void qml_material::sk::GetSpotParams | ( | scalar | occluderZ, |
| scalar | lightX, | ||
| scalar | lightY, | ||
| scalar | lightZ, | ||
| scalar | lightRadius, | ||
| scalar * | blurRadius, | ||
| scalar * | scale, | ||
| QVector2D * | translate ) |
Calculates spot shadow parameters based on a virtual point light source.
Calculates spot shadow geometry parameters based on a point light model. zRatio determines the blur radius and the projection scale of the shadow.