You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Sort surfaces by upperY instrad of the first vertex
This commit is contained in:
@@ -132,13 +132,7 @@ static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surfac
|
|||||||
sortDir = 0; // insertion order
|
sortDir = 0; // insertion order
|
||||||
}
|
}
|
||||||
|
|
||||||
//! (Surface Cucking) Surfaces are sorted by the height of their first
|
surfacePriority = surface->upperY * sortDir;
|
||||||
// vertex. Since vertices aren't ordered by height, this causes many
|
|
||||||
// lower triangles to be sorted higher. This worsens surface cucking since
|
|
||||||
// many functions only use the first triangle in surface order that fits,
|
|
||||||
// missing higher surfaces.
|
|
||||||
// upperY would be a better sort method.
|
|
||||||
surfacePriority = surface->vertex1[1] * sortDir;
|
|
||||||
|
|
||||||
newNode->surface = surface;
|
newNode->surface = surface;
|
||||||
|
|
||||||
@@ -150,7 +144,7 @@ static void add_surface_to_cell(s32 dynamic, s32 cellX, s32 cellZ, struct Surfac
|
|||||||
|
|
||||||
// Loop until we find the appropriate place for the surface in the list.
|
// Loop until we find the appropriate place for the surface in the list.
|
||||||
while (list->next != NULL) {
|
while (list->next != NULL) {
|
||||||
priority = list->next->surface->vertex1[1] * sortDir;
|
priority = list->next->surface->upperY * sortDir;
|
||||||
|
|
||||||
if (surfacePriority > priority) {
|
if (surfacePriority > priority) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user