Class UniformColorResolver
Convenience IFaceColorResolver that returns the same color for every face. Useful for uniformly colored meshes that still need vertex color data (e.g. for a vertex-lit shader variant), or as a default placeholder while building richer resolvers.
Implements
Inherited Members
Namespace: Scylla.Core.Util.Geom
Assembly: ScyllaCore.dll
Syntax
public sealed class UniformColorResolver : IFaceColorResolver
Constructors
UniformColorResolver(Color32)
Initializes a new resolver that returns color for every face.
Declaration
public UniformColorResolver(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color | The single color returned by Resolve(int, int, Vector3). |
Methods
Resolve(int, int, Vector3)
Returns the color to assign to all vertices of the face identified by
faceIndex.
Declaration
public Color32 Resolve(int faceIndex, int faceCount, Vector3 faceCenter)
Parameters
| Type | Name | Description |
|---|---|---|
| int | faceIndex | Zero-based face index within the shape's face inventory. The valid range is
|
| int | faceCount | Total number of faces the shape will emit, useful for resolvers that need to know the upper bound (e.g. gradient sampling by index ratio). |
| Vector3 | faceCenter | Local-space center of the face, useful for resolvers that derive color from spatial position (e.g. gradient sampled by Y, or 3D noise lookup). |
Returns
| Type | Description |
|---|---|
| Color32 | The color to assign to the face's vertices. |