discosultan / penumbra

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

[Request] Penumbra OpenGL port #10

Open TheZNC opened 7 years ago

TheZNC commented 7 years ago

Great job @discosultan! Good library, i liked it! But i (think not only i) are interested in OpenGL port. Is it realizable? I think there are many people who support me, for saint cross-platform in fridges, microwaves, calculators and etc. =) Currently there are only one good OpenGL 2D lighting/shadowing engine. Krypton-XNA, but the author abandoned it from 2011. I trying to port it to MonoGame 3.5+, but no success. Dynamic shadows dont work properly. And in dev. release (Krypton) i got only black screen.

So, what about the port of your library?

Regards, TheZNC

ghost commented 7 years ago

Up, I'm also interested by this port 😄

discosultan commented 7 years ago

@TheZNC @Skelord Hey!

If it helps, I could try to push out a DesktopGL version of the library. Unfortunately, I don't plan to tackle any of the other platforms.

ddruganov commented 7 years ago

@discosultan Please do, that would a lot of people out so much! Your project is insanely good , btw!

BlizzCrafter commented 7 years ago

@discosultan totally agree on that. Penumbra is awesome! And I'm sure it will get more and more attention over time. Espacially when there is a DesktopGL or UWP port (or both). On top of everything it would be incredible helpful for indiedevs. Without a doubt: Penumbra is the best 2D lighting engine for newer MonoGame releases. It is beautiful and fast.

discosultan commented 7 years ago

@TheZNC @Skelord @SamTheT @sqrMin1 I've added DesktopGL support (https://github.com/discosultan/penumbra/commit/d3dbd3bf22ee32dae3a2fdac19f596a84e97e8f6).

I managed to do a quick smoke test but it'd be great if someone else could confirm it is working for them. The nuget is available here: https://www.nuget.org/packages/MonoGame.Penumbra.DesktopGL/

Samples are still only running on WindowsDX.

BlizzCrafter commented 7 years ago

@discosultan You are a genius! And very fast ;)

I just tested your DesktopGL solution and it works like a charm. With your solution I was able to run my Farseer Physics sample. Very nice!

I encountered just one error message:

CS0246 C# The type or namespace name could not be found (are you missing a using directive or an assembly reference?)

And this error message is in relation witth "ResourceContentManager" in MonoGame.Penumbra.DesktopGL -> PenumbraComponent.cs row 106

discosultan commented 7 years ago

@sqrMin1 It was attempting to load MonoGame dll from GAC for an invalid platform and it only happened on first run (before nuget packages were restored). I removed any nuget based references to MonoGame altogether and now attempt to reference MonoGame directly from its installation directly (similar to what MonoGame project templates do). Hopefully no more errors :) (https://github.com/discosultan/penumbra/commit/ba7f606406a6c389a5c7df2df3bd51e9428ab2a5)

BlizzCrafter commented 7 years ago

clever 👍 everything is working flawlessly now.

You did a very good job! I'm proud of you :)

This will be very helpful for many people out there. I hope that they will leave a big thank you here for you!

discosultan commented 7 years ago

I'm glad it's working for you 👍 I did find another issue with textured lights on DesktopGL which should be fixed now (https://github.com/discosultan/penumbra/commit/4c3e9f6f9f8942bda0f693549771f9cbc5301eba)

BlizzCrafter commented 7 years ago

I didn't played around with textured lights yet. But it's great that you have found and fixed another bug 🥇

Are you gathering games who are implemented your Penumbra system somewhere on a site or do you planning to do so? Could be great to see what people did or do with Penumbra ;)

Sorry for off-topic question, but I'm not sure if I should open a new "issue" for that^^ On the other hand it would be a great way to collect some links and pictures of projects.

discosultan commented 7 years ago

You can open an issue for that, that's fine :)

I know there was one simple finished or close-to-finished game making use of Penumbra but I can't recall what it was. I've also seen a few in-dev game using it, but I don't know of any which has a website or code/screenshots available.

BlizzCrafter commented 7 years ago

Thanks for the information!

Done #14 :)