discosultan / penumbra

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

.NET Core Support Possible? #18

Closed richard-hajek closed 1 year ago

richard-hajek commented 5 years ago

I know you stated that you will not update the library, so I am not asking whether you will do it, I am asking how hard would it be. As if it is easy enough I should be able to do it myself and possibly fork this one but if it is hard or near impossible without a complete rewrite, I will not attempt, because I would most likely fail tbh, Thanks

discosultan commented 5 years ago

Currently, MonoGame relies on WinForms implementations of .NET Framework or Mono for desktop GUI rendering. .NET Core 2.1 (latest as of this post) does not support WinForms, making it impossible to support it.

However, .NET Core 3.0 will introduce WinForms support for Windows platform. If MonoGame decides to support it, I'd be more than happy to move this code base over to .NET Standard. Main benefits would be faster runtime and vastly improved .csproj format to simplify code.

Here's an open issue on .NET Core support for MonoGame: https://github.com/MonoGame/MonoGame/issues/5339

richard-hajek commented 5 years ago

Wait, if I understand correctly, you're saying that MonoGame itself cannot currently run on .NET Core?

discosultan commented 5 years ago

As far as I know, yes. I haven't been following their updates for a while now, so I might be missing some information. From what I know, they plan to support it from MonoGame 3.8 (current latest is 3.7).

richard-hajek commented 5 years ago

Okay, not to argue with you, but I am running a .NET Core MonoGame game on Linux right next to me, and MonoGame download links list Linux as well link

Edit: Also I believe you can grab .NET Core version of MonoGame from nuGet if I am not mistaken link (Although the author is not MonoGame, as it is with the rest of the MonoGame nuGet packages)

discosultan commented 5 years ago

It's cool to see that there's working third party effort for .NET Core support!

The Linux download link on the official page is the Mono version of MonoGame.

It's hard to tell what problems may rise during the port. I'm mostly worried about the content pipeline, as Penumbra needs to compile custom shaders for each supported platform.

richard-hajek commented 5 years ago

If it is any help, when I attempted to build Penumbra in .NET Core it compiled successfully, don't know if that included the shaders or not though.

richard-hajek commented 5 years ago

Well, keep us updated, whether you plan to port or not!

discosultan commented 5 years ago

Personally, I will wait for official support in MonoGame 3.8 before dabbling into it. The whole .NET Core story around MonoGame is still unclear for me.

richard-hajek commented 5 years ago

Well what. Did you bloody know. If you install nuGet package Penumbra.DesktopGL it works out of the box. Just like that, no nothing needed.

Your thing does work with .NET Core.

You're a bloody genius.

Edit: Tested on HelloPenumbra, saw shadow thing rotating, the whole window was slightly blue, I suppose that's what it is supposed to do

Edit2: Well someone is definitely a genius, don't actually know if specifically you.

richard-hajek commented 5 years ago

After some testing, I have concluded, that it works reliably, had 0 problems (except for build warning me that Penumbra is not meant to run on this framework)

urusai88 commented 5 years ago

@meowxiik How are you run monogame on .net core?

richard-hajek commented 5 years ago

1) Install MonoGame like you normally would 2) Create new project 3) Add Penumbra.DesktopGL nuGet package

Should work now

romanov commented 3 years ago

Penumbra.DesktopGL is not working with Monogame UWP Core project:

System.TypeLoadException: 'Could not load type 'MonoGame.Framework.GameFrameworkViewSource`1' from assembly 
'MonoGame.Framework, Version=3.8.0.1641, Culture=neutral, PublicKeyToken=null'.'
discosultan commented 1 year ago

Closing as supported already for awhile.