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

.NET Framework Support #11

Open
ameisen opened this issue Jan 3, 2021 · 16 comments
Open

.NET Framework Support #11

ameisen opened this issue Jan 3, 2021 · 16 comments
Labels
enhancement New feature or request

Comments

@ameisen
Copy link

ameisen commented Jan 3, 2021

Any chance you could add a build configuration for .NET Framework (preferably 4.5)?

@Nominom
Copy link
Owner

Nominom commented Jan 3, 2021

Do you specifically need Framework 4.5? Would some netstandard target work? It might require a little effort since most of the internals use Span but probably not impossible.

@Nominom Nominom added the enhancement New feature or request label Jan 3, 2021
@ameisen
Copy link
Author

ameisen commented Jan 3, 2021

I believe that NET Standard 1.1 or 1.2 would work (as those reflect 4.5 and 4.5.1).

I ended up implementing my own Span in my project.

@Nominom
Copy link
Owner

Nominom commented Jan 3, 2021

I'll see what I can do. (Also, nice cat.)

@Nominom
Copy link
Owner

Nominom commented Jan 3, 2021

Seems like ImageSharp (my dependency) only supports down to netstandard1.3. Would your project be able to upgrade to Framework 4.6 or 4.7?

@ameisen
Copy link
Author

ameisen commented Jan 4, 2021

Unfortunately, no. It's a mod for a game that relies on XNA, so the framework is pretty locked.

What is needed in ImageSharp?

(He isn't in the room right now, but if he were he would respond probably by purring)

@Nominom
Copy link
Owner

Nominom commented Jan 4, 2021

ImageSharp is used for saving and loading standard image formats (jpg, png, tga..) and resizing the texture for mipmap creation. I am planning on replacing it with my own implementation eventually, but that's probably going to take a while.

If you have another way of feeding RGBA-data to the library and don't need mipmaps, then creating a dependency-free fork for net45 might be possible.

@ameisen
Copy link
Author

ameisen commented Jan 4, 2021

I don't need mipmaps, and I have zero use for standard formats. The input data is raw data (BGRA, RGBA, BGR, RGB), and I expect raw BCn results (I only need BC1/2/3).

@Nominom
Copy link
Owner

Nominom commented Jan 5, 2021

I'll whip up a stripped-down version for net45 tonight then. Might be up on nuget by tomorrow. I probably won't be maintaining that one as actively but it's there until I can get rid of ImageSharp.

@Nominom
Copy link
Owner

Nominom commented Jan 6, 2021

Hey, the net45 version is up on nuget now: https://www.nuget.org/packages/BCnEncoder.Net45

Input data needs to be as a byte array in rgba format and there is no mipmap generation. For getting raw compressed bytes you can use the BcEncoder.EncodeToRawBytes API.

If you use it and find anything lacking or something not working correctly, hit me up with another issue.

@ameisen
Copy link
Author

ameisen commented Jan 9, 2021

I haven't had a chance to use it yet, I've been very busy at work and haven't had an opportunity to work on this project.

@Nominom
Copy link
Owner

Nominom commented Jan 9, 2021

Alright. Let me know if you do and need anything changed. For now I think this issue can be marked as closed.

@Nominom Nominom closed this as completed Jan 9, 2021
@tokke001
Copy link

hey @Nominom ,
any chance you plan on an update of the .NET Framework version to latest?

your library is very good, and i m trying to use it for my projects of reading game texture files
but there are some problems with the .NET framework version wich got fixed at the (newer) .net standard version:
i think issues in the alpha , and no BC6 support

i tried myself to convert the latest 2.1.0 version to .NET framework 4.7.2 (wich has support for .NET Standard 2.0) :
but i didnt succeed and had empty textures

if you would find time (and energy),
because i think you know your code better for this
i would appreciate very much
but anyway: still a great library ! :)

@Nominom
Copy link
Owner

Nominom commented May 12, 2022

Hi!

I'm currently in the process of making version 3.0, which includes many major refactors and improvements. I could look into adding support for older .NET Standard versions in the same update. It would be quite a pain to manually import the new changes to the net45 branch since they are so different.

I can't promise anything concrete for now, but I'll reopen this issue and keep you posted!

@Nominom Nominom reopened this May 12, 2022
@tokke001
Copy link

yes,
i know what you mean, i noticed myself the changes between the two versions

thanks, i ll keep an eye on the project for sure !

@UlyssesWu
Copy link

UlyssesWu commented Jul 3, 2022

I just made a .NET standard 2.0 port (with minimal changes), in order to use it in .NET Framework 4.8 projects.
https://github.com/MonarchSolutions/BCnEncoder.NET

And here is the myget package so you can use it now:
https://www.myget.org/feed/monarchsolutions/package/nuget/BCnEncoder.NetStd

Unit tests show 185/200 cases passed, so I guess maybe there are still something wrong?
But at least the BC7 decode/encode is working for me.
bcN-test

I should warn that I didn't measure the performance, and it should be very bad comparing to the original .NET standard 2.1 version, because I have to replace Nominom's carefully constructed high-performace span/memory codes to some very bad performance codes like Span<T>.ToArray(). My project don't care much about this performance at the moment.

@RonaldZaZ
Copy link

Is it possible to support netstandard2.0? I'm trying to write an shell extension using shellsharp which only support net framework. I can't consume netstandard2.1 from net framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants