godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add an option to extend the edges of a VoxelGI infinitely #10100

Open BenLubar opened 3 months ago

BenLubar commented 3 months ago

Describe the project you are working on

A 3D game with a top-down camera view and player-created levels

image

Describe the problem or limitation you are having in your project

The global illumination has a visible "end". The edges of the level go down 4096 meters to create the "infinite" effect, but I don't want to waste memory by computing lighting information very far below the camera.

image image image

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add an option on the VoxelGI node to always consider it as a possible illumination contributor regardless of the position of the pixel being rendered.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A VoxelGI node with the new boolean property set is used when no VoxelGI node covers a given pixel. The light color on that position is whatever the closest light color information in the VoxelGI is to that point. So if the pixel being rendered is directly below the volume, it uses one of the light colors from the bottom face of the cube, and if a pixel being rendered is closest to the corner of the cube, it uses the corner lighting information, and so on.

Pixels being rendered that are already covered by one or more VoxelGI nodes are not affected.

If this enhancement will not be used often, can it be worked around with a few lines of script?

As far as I know, no.

Is there a reason why this should be core and not an add-on in the asset library?

VoxelGI is, as far as I can tell, tightly integrated into Godot's rendering code and its behavior can't be modified by subclassing it in a script.

DriverBunny37 commented 1 month ago

An edge fading option is also great.