Skip to content

Add screenshot test for PBR glossiness pipeline (#2587)#2846

Open
Ojas2095 wants to merge 1 commit into
jMonkeyEngine:masterfrom
Ojas2095:pbr-glossiness-test
Open

Add screenshot test for PBR glossiness pipeline (#2587)#2846
Ojas2095 wants to merge 1 commit into
jMonkeyEngine:masterfrom
Ojas2095:pbr-glossiness-test

Conversation

@Ojas2095
Copy link
Copy Markdown

@Ojas2095 Ojas2095 commented Jun 5, 2026

Fixes #2587 by adding a screenshot test for the PBR glossiness pipeline. See #2586 for context.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +43 to +46
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"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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).

Suggested change
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"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a screenshot test that tests for the pbr glossiness pipeline

1 participant