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

Release shadow mapping resources when not needed #12497

Merged
merged 2 commits into from Jul 9, 2022

Conversation

x2048
Copy link
Contributor

@x2048 x2048 commented Jul 1, 2022

This PR removes the shadow mapping textures to release GPU memory when shadow intensity is changed to 0. It also cleans up code where shadow texture is assigned to map and entities.

To do

This PR is Ready for Review.

How to test

  1. Enable the following mod:
core.register_chatcommand("s", {
	params = "intensity",
	func = function(name, param)
		local player = core.get_player_by_name(name)
		player:set_lighting({ shadows = { intensity = tonumber(param) } })
	end
})
  1. Enable the shadows and enter the game
  2. Toggle shadows with /s 0 and /s 1 commands
  3. Shadows must disappear and reappear without error messages or crashing the game

@x2048 x2048 added @ Client / Audiovisuals Roadmap The change matches an item on the current roadmap. Performance labels Jul 1, 2022
@x2048 x2048 self-assigned this Jul 1, 2022
@lhofhansl
Copy link
Contributor

Looks like this is breaking self-shadowing of entities.
You can try with the https://content.minetest.net/packages/apercy/steampunk_blimp/ blimp. Notice that with this change the airship does not a shadow on itself - or more precisely it always seems to be in the shade.

Remove redundant code in WieldMesh
Assign SM texture to receivers when added to the list or texture initialized
@lhofhansl
Copy link
Contributor

Works.

@x2048 x2048 merged commit 7c26111 into minetest:master Jul 9, 2022
@x2048 x2048 deleted the shadow_textures branch July 9, 2022 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals One approval ✅ ◻️ Performance Roadmap The change matches an item on the current roadmap.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants