You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Core/Universe.m
+26-12Lines changed: 26 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -4407,24 +4407,39 @@ - (void) drawUniverse
4407
4407
4408
4408
BOOL fogging, bpHide = [self breakPatternHide];
4409
4409
4410
-
float pass1FarPlane = INTERMEDIATE_CLEAR_DEPTH;
4411
4410
drawCounter++;
4411
+
float breakPlane = INTERMEDIATE_CLEAR_DEPTH;
4412
+
for( int i = 0; i < draw_count; i++ )
4413
+
{
4414
+
if ([my_entities[i] cameraRangeFront] > breakPlane)
4415
+
{
4416
+
continue;
4417
+
}
4418
+
if ([my_entities[i] cameraRangeBack] > breakPlane)
4419
+
{
4420
+
breakPlane = [my_entities[i] cameraRangeBack];
4421
+
}
4422
+
}
4423
+
4424
+
OOLog( @"kja", @"breakPlane: %f", breakPlane );
4412
4425
4426
+
// We need to bring forward the near plane of the frustum on the long distance pass by this factor to avoid clipping objects at the corner of the window
float ratio = (displayGUI ? 0.5 : [gameView fov:YES]) * nearPlane; // 0.5 is field of view ratio for GUIs
4418
-
float nearDistance = sqrt(nearPlane*nearPlane + ratio*ratio*(1+1/(aspect*aspect))); // distance to object that's on the near plane and in the corner of the screen
0 commit comments