google / nerfactor

Neural Factorization of Shape and Reflectance Under an Unknown Illumination
https://xiuming.info/projects/nerfactor/
Apache License 2.0
437 stars 56 forks source link

brdf_scale #26

Closed SirSykon closed 1 year ago

SirSykon commented 1 year ago

I've seen there is a constant named brdf_scale to scale the brdf value. Where does this constant come from and what its value is?

Thanks!

SirSykon commented 1 year ago

No. I'm trying to understand how the code works and I've tested the brdf_mlp with some random values obtaining very high values (10 e6). Since albedo is between 0 and 1, the differences between scales are strange andthat's the reason I was curious about the brdf_scale but I think is 1.

Is it the expected mlp_brdf to return so high values?

malfonsoarquimea commented 1 year ago

I am having a similar problem. I am doing some modifications to the code and now, I see that the brdf_mlp produces very large values ranging from 1e4 to 1e6 or so. This results on the albedo being not optimized as the final RGB value depends mostly on the specular, which has much higher values than the albedo

xiumingzhang commented 1 year ago

Hi both, that constant for scaling the BRDF is an artificial scale set empirically. The reason is that the unit of BRDFs is often ambiguous and not physically rigorous. For example, when we pretrained our BRDF MLP on the MERL BRDFs, it was unclear what unit the MERL BRDFs used. Plus, the light probe intensities are not metric either, so somewhere along the rendering pipeline, one would need some scaling, whether at the BRDF output or the final rendering. Feel free to reopen this if you need further help.

SirSykon commented 1 year ago

Hello! I understand your answer but checking the configuration, brdf_scale seems to be 1 so it would be the same to ignore it. Should it be changed for each scene? Thanks

xiumingzhang commented 1 year ago

Hi @SirSykon. Shouldn't need to change that for each scene. Usually, we set one brdf_scale for each BRDF pertaining dataset (e.g., the MERL dataset) because that's what determines the "scale."