Skip to content
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

Implementing light range support in Metal #1638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

colincornaby
Copy link
Contributor

This fixes the popping issue discovered while investigating bump maps in BumpDemo.

Similar changes may need to be done to OpenGL. These changes will also need to be back ported into the per pixel lighting branch.

@@ -2374,6 +2374,8 @@ void plMetalPipeline::IEnableLight(size_t i, plLightInfo* light)
plDirectionalLightInfo* dirLight = nullptr;
plOmniLightInfo* omniLight = nullptr;
plSpotLightInfo* spotLight = nullptr;

const float maxRange = 32767.f;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const float maxRange = 32767.f;
constexpr float kMaxRange = 32767.f;

@@ -2383,6 +2385,9 @@ void plMetalPipeline::IEnableLight(size_t i, plLightInfo* light)
fLights.lampSources[i].constAtten = 1.0f;
fLights.lampSources[i].linAtten = 0.0f;
fLights.lampSources[i].quadAtten = 0.0f;

fLights.lampSources[i].range = maxRange;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fLights.lampSources[i].range = maxRange;
fLights.lampSources[i].range = kMaxRange;

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.

3 participants