Vixen
02b45cc4
csharp
public readonly record struct SpriteVertex

One corner of a sprite quad, in the layout the sprite shaders read.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ The same three attributes as ParticleVertex, and deliberately not the same type. They agree today because a textured quad has nothing else in it, and a shared struct would make the next thing either of them needs — a second UV set for a sprite's normal map, a per-particle random — a change to both. What they can share is the layout: a project that wants one pipeline for both registers one entry in EffectPipelineDescriber.VertexLayouts and points both features at it.

Local space, not world. A sprite is a flat quad in its own XY plane and where it sits is TransformRenderFeature's answer, pushed as a constant — so the geometry is the same for every view that draws it and is built once a frame rather than once a view. That is the difference between this and the particle expansion, which faces a camera and therefore cannot be.

Fields and properties (3)

  • public Vector3 Position

    Where it is, in the sprite's own space with the pivot at the origin.

  • public Vector2 Texture

    Which texel it samples, in UVs.

  • public Vector4 Colour

    The tint, multiplied into the sample.

Methods (1)

  • public SpriteVertex(Vector3 Position, Vector2 Texture, Vector4 Colour)

    One corner of a sprite quad, in the layout the sprite shaders read.

Used by (3)

  • SpriteGeometryVixen.Rendering
  • SpriteRenderFeatureVixen.Rendering
  • SpriteTestsVixen.Rendering.Tests