SIsilicon / Godot-Lens-Flare-Plugin

MIT License
66 stars 9 forks source link

Godot 4 version? #7

Open unfa opened 2 years ago

unfa commented 2 years ago

I wonder how hard would it be to port this to Godot 4...

SIsilicon commented 2 years ago

Shouldn't be too difficult, but as for me, I'm not in the right situation to do so.

unfa commented 2 years ago

I may try to do that myself, I'll try to make a pull request if I manage to do so.

SIsilicon commented 2 years ago

Go right ahead.

Vadimledyaev commented 2 years ago

I may try to do that myself, I'll try to make a pull request if I manage to do so.

Hi, Have you succeed with re-writing it for Godot v4?

unfa commented 2 years ago

No, sorry. I couldn't figure it out.

Zylann commented 2 years ago

I think the QuadMesh needs to be flipped with flip_faces=true, it appears to fix it for my atmosphere plugin.

Well... almost. It doesnt look good for some reason image

Zylann commented 2 years ago

Check here for the version I ported to Godot 4: https://github.com/Zylann/solar_system_demo/tree/godot4/addons/SIsilicon.vfx.lens%20flare

Zylann commented 2 years ago

Still some details had to be ported, but I can't seem to get the same result. I wonder what changed in Godot 4 for this to look like this (Godot 4 on the left): image

Sampling lods from SCREEN_TEXTURE has a much worse quality than Godot 3... because Godot 3 was apparently doing gaussian blur on its mip, so it had higher quality. But Godot 4 no longer does that, so it looks worse.

We could do bicubic sampling in the shader ourselves but IMO that would be prohibitively slow for every sample done by this effect. It would be worse than if mips were smoother in the first place, because blur is done once per mip, while this effect would have to do that 24 times (with default settings).

unfa commented 2 years ago

I've been playing with a full-screen quads in Godot 4 and they currently break Temporal AA, because the quad overwrites motion vectors in the render buffer.

Zylann commented 2 years ago

Was this reported? Not being able to do postprocessing with TAA is quite a deal breaker.

unfa commented 2 years ago

@Zylann I've risen this issue in the Godot Contributors chat, though it'd be probably bet to report it in the dev tracker too.

Zylann commented 1 year ago

Since I had a working version in Godot 4 for a while now, should I do a PR to this repo? Or if it's no longer maintained, can I make a fork myself and upload it to the asset library?