1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Merge pull request #103934 from LiveTrower/dfg-lut

Forward+: Replace the current BRDF approximation with a DFG LUT and add multiscattering energy compensation
This commit is contained in:
Thaddeus Crews
2025-05-09 11:29:16 -05:00
8 changed files with 250 additions and 24 deletions

View File

@@ -1714,7 +1714,8 @@ void main() {
light_compute(normal, directional_lights.data[i].direction, view, size_A,
directional_lights.data[i].color * directional_lights.data[i].energy * tint,
true, shadow, f0, orms, directional_lights.data[i].specular, albedo, alpha, screen_uv,
true, shadow, f0, orms, directional_lights.data[i].specular, albedo, alpha,
screen_uv, vec3(1.0),
#ifdef LIGHT_BACKLIGHT_USED
backlight,
#endif
@@ -1745,7 +1746,7 @@ void main() {
uvec2 omni_indices = instances.data[draw_call.instance_index].omni_lights;
for (uint i = 0; i < sc_omni_lights(); i++) {
uint light_index = (i > 3) ? ((omni_indices.y >> ((i - 4) * 8)) & 0xFF) : ((omni_indices.x >> (i * 8)) & 0xFF);
light_process_omni(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, scene_data.taa_frame_count, albedo, alpha, screen_uv,
light_process_omni(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, scene_data.taa_frame_count, albedo, alpha, screen_uv, vec3(1.0),
#ifdef LIGHT_BACKLIGHT_USED
backlight,
#endif
@@ -1773,7 +1774,7 @@ void main() {
uvec2 spot_indices = instances.data[draw_call.instance_index].spot_lights;
for (uint i = 0; i < sc_spot_lights(); i++) {
uint light_index = (i > 3) ? ((spot_indices.y >> ((i - 4) * 8)) & 0xFF) : ((spot_indices.x >> (i * 8)) & 0xFF);
light_process_spot(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, scene_data.taa_frame_count, albedo, alpha, screen_uv,
light_process_spot(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, scene_data.taa_frame_count, albedo, alpha, screen_uv, vec3(1.0),
#ifdef LIGHT_BACKLIGHT_USED
backlight,
#endif