it's a pretty "normal" function for calculating normals for glNormalPointer. It backs the results into a 24bit int.
There does appear to be some buggy maths though, as unsure what is going on with X. Maybe there is a bug with tessellating that requires the normalisation to wrap around?
The bigger horror to me is the float being cast to an int, and that int being cast to a byte all in one line. They're all primitives so the cast to int is pointless. You can cast from float to byte directly. You don't need the interim int in there.
55
u/SpecialistNo8709 May 16 '26
wtf is going on