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

Store a material's "original" texture dimensions in special members #222

Merged
merged 2 commits into from
May 12, 2022

Conversation

res2k
Copy link
Contributor

@res2k res2k commented May 8, 2022

…instead of the image_base width & height.

This allows to re-use the same "base" texture for multiple materials, even if
the original textures have different dimensions/aspect ratios.

Previously, when doing so, the image's width/height members would be repeatedly
overwritten, and whatever original texture was loaded last, that dimensions
would "win". When the various original textures had different aspect ratios
some texture scaling factors would've been wrong (and the texture appear
distorted).

(This doesn't occur with Q2RTX materials, but I stumbled upon that when creating some custom materials.)

…nstead of

the image_base width & height.

This allows to re-use the same "base" texture for multiple materials, even if
the original textures have different dimensions/aspect ratios.

Previously, when doing so, the image's width/height members would be repeatedly
overwritten, and whatever original texture was loaded last, that dimensions
would "win". When the various original textures had different aspect ratios
some texture scaling factors would've been wrong (and the texture appear
distorted).
@apanteleev
Copy link
Collaborator

Somehow, these changes break all polygon lights, they no longer emit anything.

@res2k
Copy link
Contributor Author

res2k commented May 12, 2022

Somehow, these changes break all polygon lights, they no longer emit anything.

Well, not all of them, just those that aren't "entire texture emissive" 😬
(Of course, the map I noticed the size bug in, which has multiple poly lights, and which used to check the changes in, were all "entire texture emissive". 🤦🏻‍♂️)

@apanteleev apanteleev merged commit 509522b into NVIDIA:master May 12, 2022
@res2k res2k deleted the separate-original-width branch February 11, 2023 12:03
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.

2 participants