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

Godot 4.0 Support #3

Open
FrobtheBuilder opened this issue Oct 25, 2022 · 4 comments
Open

Godot 4.0 Support #3

FrobtheBuilder opened this issue Oct 25, 2022 · 4 comments

Comments

@FrobtheBuilder
Copy link

I'd like to use this in a Godot 4.0 project and I think I see how you'd go about upgrading it to work. It looks like the only incompatibility is with the exports and setter/getter syntax. However, I'm still pretty new to the engine so I'm not sure if the shader is going to implode or something if I fix the script, and also I think they changed some stuff about how viewports work. Fixing that would probably be beyond me, plus I'm not sure if this library will do exactly what I want in the first place... I'm looking for a method of getting decent antialiased pixel art upscaling to non-integer screen resolutions for a 2D game.

  1. Do you think the shader is still compatible with the new Vulkan backend? I saw a few of these warnings in the editor, but no errors.
    image
  2. Would you rather just do the porting yourself, or would you accept a PR from me if I fixed the script?
  3. Can this library actually do what I'm looking for? It looks to me like it should be able to, but I'm not certain.
@cybereality
Copy link
Owner

I did actually port it to Godot 4.0, but I never released it. This is because Godot 4.0 has built-in scaling options that are better than this. If you enable the Advanced Options in the Project Settings, there is a mode for Scaling 3D. This uses either Bilinear Interpolation or AMD FSR. I am not sure if it works for 2D, maybe not. But I did some testing, and these options were better than my shader in terms of the quality and performance. So I opted not to release the code, since it wouldn't be useful. If you want to use this for 2D, I can clean up the port and post the code, it wouldn't be that much work. I just didn't think anyone would use it.

@FrobtheBuilder
Copy link
Author

FrobtheBuilder commented Oct 25, 2022

Yeah the crazy thing is I actually tried using the various antialiasing options in the settings, but no dice. MSAA doesn't work on textures and FXAA seems to apply AFTER upscaling, so I still get oddly shaped pixels everywhere. Aaaaand... I just checked and sadly the 3D scaling options don't apply at all to 2D viewports. This is making me sad. What I need is to scale up to an integer and then scale back down with antialiasing. Would you mind sharing the port so I can give it a try? I've got a slightly unusual use case here, I need to accommodate flip screen on one dimension so I don't want to zoom the camera too much for different resolutions.

@cybereality
Copy link
Owner

So my add-on doesn't do integer scaling. I was going to add it originally, but I didn't get much interest, so I stopped working on it. Also, since I mainly work in 3D, I didn't need it for anything I was doing. But I know how to do it. Just give me like a day or two to take a look at the code, it's shouldn't be too difficult.

@FrobtheBuilder
Copy link
Author

Oh thanks, that would be very helpful. I've been playing around with other camera systems in the meantime but even fully dynamic the size of the viewport I want just doesn't quite line up with the closest integer scales at 1080p, to say nothing of other resolutions. Being able to scale arbitrarily with antialiasing would help me out a lot, but I'm just not quite sure how to make it happen myself.

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

No branches or pull requests

2 participants