Add screenshot test for PBR glossiness pipeline (#2587)#2846
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new screenshot test class, TestPBRGlossinessMap, to verify PBR glossiness map rendering. The feedback recommends using different textures for BaseColorMap and GlossinessMap instead of reusing dirt.jpg for both, to avoid potential texture caching conflicts and color space inconsistencies (sRGB vs. Linear) in the AssetManager.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| Material pbrMat = new Material(assetManager, "Common/MatDefs/Light/PBRLighting.j3md"); | ||
| pbrMat.setBoolean("UseSpecGloss", true); | ||
| pbrMat.setTexture("GlossinessMap", assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg")); | ||
| pbrMat.setTexture("BaseColorMap", assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg")); |
There was a problem hiding this comment.
Using the exact same texture (dirt.jpg) for both BaseColorMap and GlossinessMap can lead to texture caching conflicts in the AssetManager. Since color maps (like BaseColorMap) and data maps (like GlossinessMap) should ideally be loaded with different color spaces (sRGB vs. Linear), sharing the same texture instance can cause rendering inconsistencies if one of them overrides the other's color space settings in the cache. It is highly recommended to use a different texture for the GlossinessMap (for example, Textures/Terrain/splat/road.jpg or Textures/Terrain/splat/grass.jpg).
| Material pbrMat = new Material(assetManager, "Common/MatDefs/Light/PBRLighting.j3md"); | |
| pbrMat.setBoolean("UseSpecGloss", true); | |
| pbrMat.setTexture("GlossinessMap", assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg")); | |
| pbrMat.setTexture("BaseColorMap", assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg")); | |
| Material pbrMat = new Material(assetManager, "Common/MatDefs/Light/PBRLighting.j3md"); | |
| pbrMat.setBoolean("UseSpecGloss", true); | |
| pbrMat.setTexture("GlossinessMap", assetManager.loadTexture("Textures/Terrain/splat/road.jpg")); | |
| pbrMat.setTexture("BaseColorMap", assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg")); |
Fixes #2587 by adding a screenshot test for the PBR glossiness pipeline. See #2586 for context.