From 003f51a0a90d1cf93fbea3c7302565b07c4f87b0 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Wed, 26 Jun 2024 11:37:45 -0300 Subject: [PATCH] Fix Unlit being unable to use materials in range [512; 4096) Only PBS uses the first 9 bits, as the rest is used for skeletal animations. Unlit can use the full index. Regression started in v2.3 Thanks user haloman30 for discovering this bug: https://forums.ogre3d.org/viewtopic.php?p=556165#p556165 --- Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any b/Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any index 7e18e1bd3a3..71e9b02a5db 100644 --- a/Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any +++ b/Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any @@ -43,7 +43,7 @@ @piece( LoadMaterial ) @property( !lower_gpu_overhead ) @property( syntax != metal ) - ushort materialId = worldMaterialIdx[inPs.drawId].x & 0x1FFu; + ushort materialId = worldMaterialIdx[inPs.drawId].x; #define material materialArray[materialId] @else #define material materialArray[inPs.materialId]