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

Fix lighting of upright_sprite entities #12336

Merged
merged 1 commit into from
May 20, 2022

Conversation

x2048
Copy link
Contributor

@x2048 x2048 commented May 16, 2022

The goal is to fix lighting of upright_sprite entities broken in cef252b. Upright sprite entities (icons on drawers or player entity in devtest game) would not take light of the current node into account when shaders are enabled and always be drawn in full brightness.

Example devtest player in a dark cave;
image

cef252b removed a call to IMeshSceneNode::setReadOnlyMaterials(true), meaning that materials in IMeshSceneNode would take precedence over the materials of its mesh buffers. GenericCAO::setNodeLight() was still using mesh buffer materials directly.

This PR changes GenericCAO::setNodeLight() to work with IMeshSceneNode materials via getMaterial() call.

To do

This PR is a Ready for Review.

How to test

  1. Start devtest
  2. Go underground
  3. Switch camera to 3rd person mode
  4. Player entity must be black due to no light nearby.

Use MeshNode materials to set the light since ReadOnlyMaterials is now false
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

LGTM

@x2048 x2048 merged commit a4ef62f into minetest:master May 20, 2022
@x2048 x2048 deleted the upright_entity_light branch May 20, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants