Issue with texcoords in Intel GPU Research Sponza PBR glTF #5846
-
Hello, I am trying to use Assimp to load the PBR Sponza created by Intel, available for GPU Research: https://www.intel.com/content/www/us/en/developer/topic-technology/graphics-research/samples.html. I am using the glTF file and I reduced the size of the textures by half in each axis. I am hitting a weird issue with the UVs, and now I am suspecting it might be the importer that is getting them wrong. The most visible place is the columns: You can see there is a strange issue with the UVs there. I verified this is because the texture is being sampled from the wrong places. But with RenderDoc I can render the UVs I am using (which are the same ones that get received in the importer), and they look like this: Therefore, I am pretty convinced the UVs are wrong. I am loading the model with: const aiScene *scene = importer.ReadFile(
modelPath,
aiProcess_PreTransformVertices | aiProcess_GenSmoothNormals
| aiProcess_FixInfacingNormals | aiProcess_JoinIdenticalVertices
| aiProcess_CalcTangentSpace | aiProcess_TransformUVCoords
| aiProcess_Debone | aiProcess_FindInstances
| aiProcess_FindInvalidData | aiProcess_GenUVCoords
| aiProcess_EmbedTextures | aiProcess_GenBoundingBoxes
| aiProcess_RemoveRedundantMaterials | aiProcess_ImproveCacheLocality
| aiProcess_Triangulate
); I tried disabling several processings, like I also verified that Can someone help me investigate further? As I am a bit stuck now... Blender is able to get those UVs somehow, I was wondering if it is some kind of UV mode or something that the glTF importer does not support? If you look at my RenderDoc capture, the UV's seem pretty "box-like" to me, compared to what the correct ones should be. In Blender I can see that the heads get loaded as a single object together with the column bodies, with two materials, Idk if that may be affecting something. EDIT: loading with only EDIT2: I opened the file with Node.js, and followed the glTF format to decode the UVs from the
Rendering with those UVs yields the correct result. The UVs I get from assimp are these instead:
So the Y coordinate seems to be wrong somehow 🤔 EDIT3: 🤦 I just realized the Y uv coords are being flipped, that seems to be the issue then(?). A bit weird bc I remember I tried with flipUVs as well... let me double-check. Any help is appreciated 🙏. Also please let me know if I should better ask somewhere else. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It was indeed the UV Y flip! I would have sweared that is the first thing I tested! Anyways, closing this then. |
Beta Was this translation helpful? Give feedback.
It was indeed the UV Y flip! I would have sweared that is the first thing I tested! Anyways, closing this then.