Skip to content

Commit

Permalink
Fix Unlit being unable to use materials in range [512; 4096)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
darksylinc committed Jun 26, 2024
1 parent 734663d commit 003f51a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Samples/Media/Hlms/Unlit/Any/800.PixelShader_piece_ps.any
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 003f51a

Please sign in to comment.