samuelbigos / godot_2d_global_illumination

2D Global Illumination shader in Godot.
https://samuelbigos.github.io/
MIT License
196 stars 9 forks source link

Porting to Godot 4.2 #3

Open Robert-K opened 1 month ago

Robert-K commented 1 month ago

Hey, I've taken to porting this to Godot 4.2.2 over at Robert-K/godot-2DGI..

Just took a few small fixes to get it running, but there's some glitching going on which I couldn't eliminate so far:

https://github.com/user-attachments/assets/64827aba-58b4-46c7-8de7-6e645c9b5161

Anyone have some ideas?

samuelbigos commented 1 month ago

Nice job on the port! I gave it a quick test, it looks like uninitialized memory to me, perhaps some buffer not being cleared properly? I don't think it's related to the last frame data since disabling bounces still exhibits similar corrupted behaviour. Switching rendering mode to gl_compatibility fixes the flickering but introduces some other issues.

Now that Godot 4 has compute shader support, I would be tempted to do everything in compute instead of with viewports, it might be more stable and certainly more performant.

Robert-K commented 1 month ago

Thanks for the suggestions! I guess I'll start from scratch with compute shaders, that's a great idea :)) I'm planning on implementing radiance cascades, so most of the raycasting code wouldn't have survived anyways ^^

samuelbigos commented 1 month ago

Ah, good luck! Yes, I have seen the radiance cascades approach and have been wanting to try it out myself.

I think starting from scratch is a good idea, it's quite a different approach and as you say I doubt any of the code would be re-used.