open_pbr_surface` with `specular_weight = 0` gets darker at grazing angles in GLSL
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- computer-graphics
Direzione di ricerca
Start by reading mx_dielectric_bsdf.glsl, especially the three branches that compute F90 and the throughput to the base layer. Reproduce the reported grazing-angle darkening with the attached material and uniform environment, then compare against oren_nayar_diffuse_bsdf. Done when the cause is understood and the corrected result behaves as expected without regressions for other F0 values.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, and thanks for MaterialX! I noticed something while comparing renderers and wanted to check whether this is expected.
With open_pbr_surface, specular_weight = 0 and a grey base colour (0.18), a sphere under a uniform white environment gets darker toward the silhouette in MaterialXView 1.39.5. I expected it to look flat, like oren_nayar_diffuse_bsdf on its own does.
| Material | centre | 90 % radius | 98 % radius |
|---|---|---|---|
open_pbr_surface, specular_weight = 0 |
0.178 | 0.169 | 0.139 (about −22 %) |
oren_nayar_diffuse_bsdf only |
0.181 | 0.181 | 0.181 |
I see the same thing in OpenUSD Storm with MaterialX 1.39.4.
What I think might be happening
With specular_weight = 0, OpenPBR sets the dielectric IOR to 1, so F0 is 0 and the specular response is zero. But in mx_dielectric_bsdf.glsl the throughput to the base layer seems to use a fixed F90 of 1.0:
vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp;
bsdf.throughput = 1.0 - dirAlbedo * weight;
So the base layer still loses some energy at grazing angles, even though nothing is reflected. I might be misreading this, so please correct me if so.
As a quick test, I changed F90 to clamp(50.0 * F0, 0.0, 1.0) (the Filament approximation) in the three branches of that file. The open_pbr_surface render then matched oren_nayar_diffuse_bsdf exactly. I only tested the IOR = 1 case, so I'm not sure this is the right fix in general. It only changes results when F0 is below 0.02.
The same code is still on main (12de4d3).
To reproduce
Material (diffuse18_openpbr.mtlx, attached):
<?xml version="1.0"?>
<materialx version="1.39">
<open_pbr_surface name="SR_diffuse18" type="surfaceshader">
<input name="base_color" type="color3" value="0.18, 0.18, 0.18" />
<input name="specular_weight" type="float" value="0.0" />
</open_pbr_surface>
<surfacematerial name="M_diffuse18" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="SR_diffuse18" />
</surfacematerial>
</materialx>
white_env.hdr (attached) is a small HDR with every pixel 1.0.
MaterialXView --material diffuse18_openpbr.mtlx --mesh resources/Geometry/sphere.obj --envRad white_env.hdr --envMethod 0 --envSampleCount 1024 --enableDirectLight false --shadowMap false --drawEnvironment false --screenColor 0,0,0 --cameraViewAngle 0 --captureFilename openpbr.png
Environment: MaterialX 1.39.5 official Windows build, NVIDIA RTX 4070 Ti, Windows 10.
Attached: the two .mtlx files, white_env.hdr, a radial profile plot, and a side-by-side comparison image.
Thanks for taking a look!
- Lingua principale
- C++
- Stelle
- 2.3k
- Fork
- 472
- Merge medio
- 1g 4h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AcademySoftwareFoundation/MaterialX
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AcademySoftwareFoundation/MaterialX#3140 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
AcademySoftwareFoundation/MaterialX#3139 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AcademySoftwareFoundation/MaterialX#3138 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
AcademySoftwareFoundation/MaterialX#3137 ·
I maintainer di solito rispondono entro 2 giorni
-
Cyclic 'inherit' on TargetDefs causes an infinite loop and unbounded memory growthForse già presa @shubhamrai9122-creator l’ha presa 33 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AcademySoftwareFoundation/MaterialX#3096 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di AcademySoftwareFoundation/MaterialX
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mw00/project-maya#1368 ·
I maintainer di solito rispondono entro 2 giorni
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[LLK][QSR][PERF] eltwise_binary: perf harness INIT enables direct indexing, production does notAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
tenstorrent/tt-metal#67662 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
maplibre/maplibre-native#5159 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement question
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lbr-stack/lbr_fri_ros2_stack#420 · 1 commento ·