Vixen
02b45cc4
csharp
public struct Light

An entity that lights the scene.

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

Remarks

Everything a light is except where it is. Position, direction and the axis a tube or a rectangle is oriented along all come from the transform, the same way a mesh's do — which is what makes a spot light something you aim with the rotate gizmo rather than by typing a vector, and what stops a file saying two different things about where a light points.

The authored light, against RenderLight's per-frame one. This is what a .vxscene holds and an inspector edits; that is what the lighting feature reads, with the transform already folded in. The fields line up so that LightExtractionSystem is a copy rather than a translation.

⚠ It lives here because this is the assembly that knows what a light is. Vixen.Engine references no graphics API and cannot name LightKind, so this component spent a while in the editor's scene view — authored, saved, and invisible to any build. The arrangement that fixes it is the one Vixen.Physics and Vixen.Audio already use: the subsystem references the ECS and the engine, and owns both its components and the system that bridges them.

⚠ [Component] and [DataContract], which together are what declares it to SceneComponentRegistry. The contract gives it a serializer and a member description — the rows an inspector draws — and the pair is the claim that a compiled scene may name it. Nothing calls a registration method; the engine's component generator emits one declaration per assembly from these two attributes.

Fields and properties (10)

  • public LightKind Kind

    Which of the five kinds it is.

  • public Color3 Colour

    Its colour, before intensity and before Temperature.

  • public float Intensity

    How bright it is, in Unit.

  • public LightUnit Unit

    What Intensity is measured in.

  • public float Temperature

    Its colour temperature in kelvin, or zero for none.

  • public float Range

    The distance at which its contribution reaches zero. Unused by a directional light.

  • public float Radius

    Its sphere radius, or a rectangle's half-height. Zero for a punctual light.

  • public float InnerAngle

    The inner cone half-angle in radians, inside which a spot is at full brightness.

  • public float OuterAngle

    The outer cone half-angle in radians, outside which a spot contributes nothing.

  • public float HalfLength

    Half a tube's length, or half a rectangle's width. Zero for a punctual light.

Used by (22)

  • ArenaThirdPersonShooter
  • LampFlickerThirdPersonShooter
  • ComponentRegistrationVixen.Rendering
  • LightExtractionSystemVixen.Rendering
  • LightExtractionTestsVixen.Rendering.Tests
  • LightsVixen.Rendering
  • TypeRegistrationVixen.Rendering
  • Vixen_Rendering_Ecs_LightSerializerVixen.Rendering
  • AddComponentMenuTestsVixen.Editor.App.Tests
  • ComponentTestsVixen.Editor.App.Tests
  • ComponentsViewVixen.Editor.App
  • CreateMenuTestsVixen.Editor.App.Tests
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • EditorApplicationVixen.Editor.App
  • IconContributionTestsVixen.Editor.App.Tests
  • LightTestsVixen.Editor.SceneView.Tests
  • MaterialIconsVixen.Editor.App
  • SceneFormatMigrationTestsVixen.Editor.SceneView.Tests
  • SceneLinesVixen.Editor.SceneView
  • SceneRenderComponentTestsVixen.Editor.Assets.Tests
  • SceneSerializerVixen.Editor.SceneView
  • StandardIconsVixen.Editor.App