jMonkeyEngine / jMonkeyEngine/jmonkeyengine
PBR Lighting issue
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 14
Description
To continue the discussion from:
https://hub.jmonkeyengine.org/t/zombiegirl-gltfloader-vs-monkeywrench/48007/15
Summary:
According to gltf specs, and on the reference viewers, the default value for metallic factor is 1. Jme's importers are setting the metallic factor to 0 to pass the test cases. The problematic line in my opinion is:
//223 of PBRLighting
vec4 diffuseColor = albedo - albedo * Metallic;
I have checked, a few other repositories, and i have not yet found that piece of math again. Additionally, the whole block:
float specular = 0.5;
float nonMetalSpec = 0.08 * specular;
vec4 specularColor = (nonMetalSpec - nonMetalSpec * Metallic) + albedo * Metallic;
vec4 diffuseColor = albedo - albedo * Metallic;
vec3 fZero = vec3(specular);
is quite unique. F0 is in all other shaders defined as:
vec3 F0 = vec3(0.04);
F0 = mix(F0, albedo, metallic);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting PBRLighting around the referenced line 223 and trace how the importers set the metallic factor. Compare the current behavior with the glTF specification, reference viewers, and the existing test cases; done means the expected metallic behavior is agreed upon and the relevant shader or importer tests reflect it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100