Skip to content

Add DotProductDouble macro and use it in Mod_Q1BSP_LoadFaces #233

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hemebond
Copy link
Contributor

Adds a new DotProductDouble macro and uses it throughout Mod_Q1BSP_LoadFaces instead of DotProduct so that lightmaps are aligned correctly. Fixes #232.

@Cloudwalk9
Copy link
Contributor

Cloudwalk9 commented Apr 26, 2025

This doesn't feel correct. DotProduct is a macro that makes no assumption of the datatype. You'd want to cast to double in the original DotProduct invocation. So we shouldn't need a double variant. But this smells like an internal double to float downcasting bug and casting feels like a hack without further investigation into why the lightmaps suck.

@hemebond hemebond marked this pull request as draft April 26, 2025 16:48
@hemebond
Copy link
Contributor Author

Very good point. I'm still testing, but it looks like I can change mtexinfo_s->vecs from float to double and achieve the same results.

@hemebond hemebond marked this pull request as ready for review April 26, 2025 17:17
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.

Incorrect lightmap rendering
2 participants