Feature: UV flip handling for (BPTC) BC6H/BC7 textures
Related to and potentially closes #6885.
Description
Adding BPTC (B6H/BC7) support using TexMat flips if osg::Image::TOP_LEFT is detected. Can be made more defensive by only triggering on BPTC.
This pull request regards the OPENMW side of the solution. Full solution will require the definitions included in the OSG fork.
There is a bit more wordiness in #6885.
Changes in OPENMW:
controller.cpp - added a texmat that is called when osg::Image::TOP_LEFT is detected. This texmat is only used when an image in the "flipbook" needs the uv flip.
nifloader.cpp - added a texmat that is called when osg::Image::TOP_LEFT is detected.
shadervisitor.cpp - added a texmat that is called when osg::Image::TOP_LEFT is detected. It is assumed no Y flip is needed for Normals.
terrain/material.cpp - added a texmat that is called when osg::Image::TOP_LEFT is detected. Ideally follows proper terrain tilling.
Checklist
Mark as done if not applicable.
- I have read the CONTRIBUTING guidelines
- My code builds and runs locally (linux, windows)
- I have included steps to replicate/confirm the changes below
- I have attached necessary supporting files or assets
Steps to Test/Replicate
Just checking it out:
- I have a build of it in discord for windows on openmw 0.51. Use the BC7 demo textures (based on the morrowind uncompressed textures compressed to BC7) and demo package v4. The only "test" I have of the controller flip rn is a meme based on golden where it flips orientation every frame.
- Create a copy of openmw 0.51, then overwrite with the demo package.
- Add the demo textures to your openmw.cfg
- Walk around.
- Ideally attach a debugger.
Building it:
- Build OSG fork.
- Build openMW pointed at the OSG fork.
- Ideally attach a debugger to a debug build.
Outstanding TODOs / Questions
- Needs more eyes.
- Have not tested on mac.
- BPTC likely requires the underlying libs to support it.
- No phones.
- Do I make the OSG merge on github?
- If this goes smoothly, ideally the OSG flipping could all be moved to texmat, but that's a pretty big shift.
- KTX?