You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Improve performance of shader lighting code in Forward renderers.
- Skip sampling shadows if attenuation is very small. - Skip computing diffuse and specular light if attenuation and shadow are very small.
This commit is contained in:
@@ -2369,11 +2369,7 @@ void fragment_shader(in SceneData scene_data) {
|
||||
continue; // Statically baked light and object uses lightmap, skip
|
||||
}
|
||||
|
||||
float shadow = light_process_omni_shadow(light_index, vertex, normal, scene_data.taa_frame_count);
|
||||
|
||||
shadow = blur_shadow(shadow);
|
||||
|
||||
light_process_omni(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, shadow, 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,
|
||||
#ifdef LIGHT_BACKLIGHT_USED
|
||||
backlight,
|
||||
#endif
|
||||
@@ -2441,11 +2437,7 @@ void fragment_shader(in SceneData scene_data) {
|
||||
continue; // Statically baked light and object uses lightmap, skip
|
||||
}
|
||||
|
||||
float shadow = light_process_spot_shadow(light_index, vertex, normal, scene_data.taa_frame_count);
|
||||
|
||||
shadow = blur_shadow(shadow);
|
||||
|
||||
light_process_spot(light_index, vertex, view, normal, vertex_ddx, vertex_ddy, f0, orms, shadow, 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,
|
||||
#ifdef LIGHT_BACKLIGHT_USED
|
||||
backlight,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user