Replies: 3 comments 1 reply
-
Moving to discussion, as there is no concrete technical implementation provided.1 Note that it's already possible to do this in Godot using custom shaders. You can see an example in 3.x here, but 4.x makes this much easier with SDF generation and access in CanvasItem shaders. I believe I've already seen this implemented by plugins in 4.x, but I can't find any right now. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
I found some time today to look into this again. I've found a shader on shader toy that does a pretty decent job at doing extremely cheap GI https://www.shadertoy.com/view/Xtcfzj and translated it into godot shader language:
there are a lot of infos on how it works (better than any way I can explain) on the shader toy page. The next step is to make it generalised by using SDF info provided from godot instead of setting up the scene manually within the shader, e.g. to make it a general purpose godot light shader. I'm trying to figure out how to use light(){} and sdf builtins for the moment. @Calinou If you know anyone that can help me along the way feel welcome to poke them here. |
Beta Was this translation helpful? Give feedback.
-
Update on this: I fiddled around and implemented a basic but highly performant 2D GI. however currently due to lack of support of MRT ( Multiple render target, see: #495 ) the solution only does GI based off sdf_texture and doesn't take normals, metallic, roughness, etc... into account. Edit: |
Beta Was this translation helpful? Give feedback.
-
Describe the project you are working on
Applies to any 2d Game
Describe the problem or limitation you are having in your project
There are currently no out-of-the-box GI solution present for 2D in Godot
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Using SDF ray-marching and screen space irradiance cache probes it is possible to get relatively cheap 2D GI
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
take a look here:
https://github.com/zaycev/bevy-magic-light-2d/tree/main
https://www.youtube.com/watch?v=swljK4Isc6g
If this enhancement will not be used often, can it be worked around with a few lines of script?
Of course it is possible to leave it to the users to implement their own GI, but considering the complexity, It would be too optimistic that a typical user could.
Is there a reason why this should be core and not an add-on in the asset library?
Actually not. But we have GI out of the box for 3D, why not 2d?
Beta Was this translation helpful? Give feedback.
All reactions