Store a material's "original" texture dimensions in special members #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…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.)