1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

Replace BRDF approximation with a DFG LUT

This commit is contained in:
LiveTrower
2025-03-10 13:12:44 -06:00
parent 1a1cc0f7b0
commit 44408eabaa
8 changed files with 250 additions and 24 deletions

View File

@@ -1705,7 +1705,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
@@ -1736,7 +1737,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
@@ -1764,7 +1765,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