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
API for light intensity and color at night and day #14091
base: master
Are you sure you want to change the base?
Conversation
a0a30f4
to
cbcfa1f
Compare
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.
only went through the DOCS. It'd be also nice having some pictures or a small video
78d8b63
to
ecd7eb7
Compare
@appgurueu @Zughy Fixes, feedback applied, rebased, and a small video added (to PR itself). |
423525e
to
1de2312
Compare
1de2312
to
5a9c097
Compare
Rebased, merged to one commit, and cleaned Lua code |
40144a3
to
4b3ed11
Compare
4b3ed11
to
60d1927
Compare
lua_getfield(L, 3, "color_ratio_coef"); | ||
if (lua_istable(L, -1)) { | ||
lighting.lightIntensity.colorRatioCoef_rgb.X = getfloatfield_default(L, -1, "r", lighting.lightIntensity.colorRatioCoef_rgb.X); | ||
lighting.lightIntensity.colorRatioCoef_rgb.Y = getfloatfield_default(L, -1, "g", lighting.lightIntensity.colorRatioCoef_rgb.Y); |
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.
these names are bad and way too long
why is it called lightIntensity
and not just intensity
?
what purpose does the _rgb
serve here? I can see that it's a vector, but why actually? We have SColorf
.
not to mention that the code style says to name variables_like_this
not variablesLikeThis
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.
In mentioning SColorf
-> it was discussed here: #14091 (comment).
I just found lightIntensity
more understandable than just intensity
. No problem to rename.
I use _rgb
because it contains three coefficients. One for each color. Also, no problem to rename.
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.
@appgurueu This is related to our previous discussion.
Add compact, short information about your PR for easier understanding:
get_sunlight_color
function, so no constants are used for sun color calculation, but configurable parameters.To do
This PR is Ready for Review.
How to test
Run game devtest and run command
set_light_intensity
from lighting mod.Screen.Recording.2024-01-02.at.17.47.51_480.mov