-
Notifications
You must be signed in to change notification settings - Fork 3
Lights #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Lights #67
Conversation
examples/lights.rs
Outdated
| // 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)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note
There was a problem hiding this comment.
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.
tychedelia
left a comment
There was a problem hiding this 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.
examples/lights.rs
Outdated
| // 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)?; |
There was a problem hiding this comment.
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.
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 |
|
@tychedelia ready for your review. i've removed the positional arguments in favor of the |
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: