discosultan / penumbra

2D lighting with soft shadows for MonoGame
MIT License
315 stars 32 forks source link

Not Updating on Hull removal. #28

Closed Superschnizel closed 4 years ago

Superschnizel commented 4 years ago

Hello and first of All: thank you for this amazing Project!

I am having a few Problems with the Removal of Hulls and it not Updating as expected. I am building a Game where there are Placeable Objects, that cast Shadows. Everything works as axpected when placing said Objects, but upon Removing the ShadowHull stays there, until there is another Update to the Shadows in the Range of the Light or another Hull is Added to the Collection. Is this intended Behaviour? Is there a better way to Remove Hulls?

i am using the OpenGL version.

discosultan commented 4 years ago

Thanks for the report @Superschnizel. I suspect a hull is not marked as dirty upon removal. This is a bug. Will tackle it tomorrow.

discosultan commented 4 years ago

@Superschnizel I've pushed a fix to master: https://github.com/discosultan/penumbra/commit/db50f96b942f9cb14f1de05f28cebb9fefa071a0

Can you check if it solves it for you? If so, I will create a NuGet patch release.

Edit: I already pushed a 1.4.2-pre pre-release to NuGet. You can test with that if it's easier.

Superschnizel commented 4 years ago

Hey, sorry for the Late response. I tried the psuh on the NuGet Package, but it does not seem to have solved my issue. More so it now seems, that a hull Update in the same Light area no longer fixes the Shadows. Also, the Lights seem to be affected. Penumbra16_01

discosultan commented 4 years ago

Thanks for testing @Superschnizel ! I'll try to reproduce the issue in coming days. If unsuccessful, I may need you to provide me with minimum instructions to do so.

Superschnizel commented 4 years ago

sure! I am basically Creating a GameObject, that has a Hull attached to it. when creating the Object in the Game World i am adding the Hull (Penumbra.Hulls.Add()) and when removing it i am removing the Hull (Penumbra.Hulls.Remove()). I am doing the Same with the LightObjects. I also tried setting the Hull.Enabled = false, with the same Results.

discosultan commented 4 years ago

@Superschnizel I just noticed I messed up building nuget packages 🤦‍♂ . 1.4.2-pre was the exact same contents as 1.4.1. I've published 1.4.3-pre now. Can you retry your example with that version?

Superschnizel commented 4 years ago

@discosultan Thanks, for now it seems like the issue is resolved, atleast i'm not able to reproduce it anymore. I will come back to you if it reemerges. I really apreciate this project and your continued support!

discosultan commented 4 years ago

@Superschnizel Glad it worked and thanks for testing again!

I've now also published 1.4.3 release nugets.