we are using MDL material files within our OptiX based ray tracer by using the compile_df() function of the mdl_wrapper provided with the OptiX 6.0.0 SDK.
Everything seems to work fine regarding the compilation and usage of the Bsdf_evaluate_function within our closest_hit program.
Solely the usage of measured materials under using a measured bsdf file (.mbsdf) does not seem to work at all (the material remains black / completely absorbing).
We tested the very same .mdl file with the Iray Material Editor to proof the correctness of the material. So we can say it doesn’t seem to be a faulty .mdl file (unless Iray Material Editor detects and fixes wrong material definitions on its own).
Is it possible, that the mdl_wrapper->compile_df() function doesn’t support measured materials with .mbsdf files yet? Or do we have to handle measured materials in a different way compared to other materials?
Yes, that’s most likely not supported. Sampling and evaluation of those is not trivial.
Do you really plan to use measured BSDF materials?
I have never seen a good measurement. Near to the grazing angles they were all too incorrect.
The MDL wrapper inside the OptiX SDK is just there because the MDL SDK was not open-sourced at that time.
Please have a look into the MDL SDK specific developer forum for more up to date information.
MDL related questions should go there. [url]MDL SDK - NVIDIA Developer Forums
Since we are using OptiX and MDL for our LiDAR-Simulation and MDL files are not available for specific LiDAR-Sensors it would be nice to use measured BSDFs within MDL as well.
Is there already some announcement regarding adding MBSDF support to the compile_df() function?
Or is it currently handled as “won’t fix” and users should implement those functionality on their own?
Or may you or I move this question to the mdl-sdk forum before?
currently we are not working on enhancing the “Mdl_helper” class of the OptiX examples.
But the CUDA example “df_cuda” in the MDL SDK contains an implementation of the required functionality:
the preprocessing of the data in "Material_gpu_context::prepare_mbsdf()" in examples/mdl_sdk/shared/texture_support_cuda.h
the measured bsdf runtime functions "df_bsdf_measurement_*" in examples/mdl_sdk/shared/texture_support_cuda.h
The callable program names expected by the generated code are (analogously to the ones in “Mdl_helper::set_texture_functions()”):
df_bsdf_measurement_resolution
df_bsdf_measurement_evaluate
df_bsdf_measurement_sample
df_bsdf_measurement_pdf
df_bsdf_measurement_albedos
You could port this functionality to the “Mdl_helper” class, calling the ported preprocessing functions in “Mdl_helper::create_program()” and adding the ported runtime functions to mdl_textures.cu.