You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Code simplifications
1. Viewport::get_visible_rect().position is always zero. So Control::get_window_rect is identical to Control::get_global_rect. Remove Control::get_window_rect since it is not used in the source code. 2. sqrt(a * a) = abs(a) for doubles 3. Simplify affine_inverse combination 4. Simplify calculation in shaders
This commit is contained in:
@@ -655,20 +655,7 @@ void main() {
|
||||
if (i >= light_count) {
|
||||
break;
|
||||
}
|
||||
uint light_base;
|
||||
if (i < 8) {
|
||||
if (i < 4) {
|
||||
light_base = draw_data.lights[0];
|
||||
} else {
|
||||
light_base = draw_data.lights[1];
|
||||
}
|
||||
} else {
|
||||
if (i < 12) {
|
||||
light_base = draw_data.lights[2];
|
||||
} else {
|
||||
light_base = draw_data.lights[3];
|
||||
}
|
||||
}
|
||||
uint light_base = draw_data.lights[i >> 2];
|
||||
light_base >>= (i & 3) * 8;
|
||||
light_base &= 0xFF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user