Skip to content

WIP Lights#67

Open
catilac wants to merge 4 commits intoprocessing:mainfrom
catilac:lights
Open

WIP Lights#67
catilac wants to merge 4 commits intoprocessing:mainfrom
catilac:lights

Conversation

@catilac
Copy link
Contributor

@catilac catilac commented Feb 6, 2026

This is very WIP. Let me know if this is the right direction, and I'll wrap it up, and some of the other light types. No materials so I can't really tell if it's working, but I know you just have to spawn a light and it will just work in bevy.

  • I've commented out the work I did to make lights work like Geometry
  • Currently it will just spawn a light on setup, and we will not repeatedly call light() inside of draw

@catilac catilac requested a review from tychedelia February 6, 2026 17:38
Comment on lines +33 to +35
// We will only declare lights in `setup`
// rather than calling some sort of `light()` method inside of `draw`
let _point_light = light_create(LightType::Point, 0.0, 0.0, 0.0)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sure, but I think we may want to consider including color as a required constructor arg since all three types share that.

Copy link
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think one question I have is about all the different possible fields that lights can have and whether it makes sense to expose them all or try to wrap them up in some common settings (i.e. illuminance for directional light and intensity for spot light could maybe be collapsed or something?).

Alternatively, if we do want to expose these settings / distinguish between the light types, maybe it does make sense to expose them as different types rather than under a single generic light type? I'm not sure.


#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LightType {
Ambient,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ambient lights are a bit weird in that they are added to the camera rather than spawned independently in the world. In that sense, they're more like a global graphics setting. I think we should punt on ambient light for now or add it as a setting for Graphics.

Comment on lines +33 to +35
// We will only declare lights in `setup`
// rather than calling some sort of `light()` method inside of `draw`
let _point_light = light_create(LightType::Point, 0.0, 0.0, 0.0)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sure, but I think we may want to consider including color as a required constructor arg since all three types share that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants