-
Notifications
You must be signed in to change notification settings - Fork 169
Improve sceGuLight* functions
#300
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
Conversation
sharkwouter
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.
There are still some changes in the result of the new code compared to the old code. You can see this in the gu/lights example.
| sendCommandf(settings->zpos,position->z); | ||
| if (components == GU_POWERED_DIFFUSE) { | ||
| ctype = GU_DIFFUSE_AND_SPECULAR; | ||
| } else if (components == GU_DIFFUSE_AND_SPECULAR) { |
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.
| } else if (components == GU_DIFFUSE_AND_SPECULAR) { | |
| } else if (components == GU_DIFFUSE_AND_SPECULAR || components == 0) { |
Otherwise the result will be different if the value given is 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 think that sending 0 should use just DIFFUSE
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.
The original code was kind = (components^6) < 1 ? 1 : 0;, which results in kind being set to 1 if components is set to 0 or 6. So setting it to DIFFUSE instead of DIFFUSE_AND_SPECULAR in the case of 0 would be an API change. Do you think the original behavior is a bug?
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.
To me it looks a bug of our previous implementation…
e9f4b4d to
3263b0c
Compare
Description
Some improvements around the
sceguLight*functions:sceGuLight*implementationCheers