Skip to content

Conversation

@catilac
Copy link
Contributor

@catilac catilac commented Feb 6, 2026

This creates the API calls for creating directional, point, and spot lights. I've added the methods to FFI as well.
Work to be done in future PRs:

  1. Python APIs
  2. We could use a demo with animated lights
  3. unlit is false for everything at the moment and maybe something I should change back before merging to main

@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.

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.

@catilac
Copy link
Contributor Author

catilac commented Feb 9, 2026

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.

Thanks so much for the feedback! I wasn't sure either but was originally leaning that they would each need their own type, and methods. I do like the idea of a common settings object, I hadn't thought about that!

EDIT: Also, this is really getting me primed for the Camera work ahead

@catilac catilac changed the title WIP Lights Lights Feb 10, 2026
@catilac
Copy link
Contributor Author

catilac commented Feb 10, 2026

@tychedelia ready for your review. i've removed the positional arguments in favor of the transform_* operations you've created

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