Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: incorrect RGBA values for some embedded textures #194

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

rafccq
Copy link

@rafccq rafccq commented Oct 1, 2023

fixes #50.
I found that the RGBA32 textures embedded in the drone guns models are already in little-endian byte order, so I byte swapped them at preprocess time so that they will be byte-swapped again by the renderer, returning to the original state.

Needs more testing though, meanwhile I will check what are all the other embedded textures and how they're rendering.

fixes blue muzzle flash from Investigation and Crash Site drone guns
@fgsfdsfgs
Copy link
Owner

fgsfdsfgs commented Oct 1, 2023

The texture swapping is kind of all over the place. The renderer expects everything in big endian, unless I changed that somewhere by mistake. I'm not sure why the embedded RGBA32 textures specifically would be in LE.
Note that theoretically the texture can be bigger than width * height, because rows can be aligned to a 8-byte boundary, though in practice with RGBA32 textures this is unlikely because width would probably be an even number.

@rafccq
Copy link
Author

rafccq commented Oct 1, 2023

I still can't understand why there are embedded LE bytes when the target machine is BE. Also I wonder how GlideN64 deals with that.

The renderer expects everything in big endian, unless I changed that somewhere by mistake

That's correct, it will always byte-swap the textures, it hasn't changed.

@fgsfdsfgs
Copy link
Owner

I guess I'll just merge this and we'll see if it breaks anything.

@fgsfdsfgs fgsfdsfgs merged commit d3d313c into fgsfdsfgs:port Oct 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GoldenEye-styled turret models have blue muzzle flashes
2 participants