Skip to content

Re-adjust model UVs when sprite texture dimensions change

Hannu Hanhi requested to merge Hannu_Hanhi/SRB2:ogl-model-uv-adjust into next

This patch fixes visual issues with models, including the Elemental Shield stomp. It extends the work in !1049 (merged) by re-adjusting the model's texture coordinates, if the sprite texture used by the model is changed to a texture with different dimensions and therefore different power-of-two padding.

The rendering of models affected by texture changes is done without VBOs, similarly to when rendering interpolated model frames, so the performance impact should not be higher than the impact of interpolated models. The VBO is not used in this case because it contains incorrect texture coordinates from the previously used sprite texture.

Merge request reports