Author Topic: custom glsl does not load linked mdl ?  (Read 346 times)

I made a custom glsl shader.
It is in a custom shelf location:

Code: [Select]
E:\Ressources\Substance_Painter\shelf\shaders
This shader is selected as main shader in Painter
So far this works.

In this glsl shader I have linked an mdl file from the following location:
Code: [Select]
E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl
The material name in the mdl shader is:
Code: [Select]
export material skin_metallic_roughness_anim
Declaration of the mdl is:

Code: [Select]
//- Declare the iray mdl material to use with this shader.
//: metadata {
//:   "mdl":"mdl::skin_metallic_roughness_anim::skin_metallic_roughness_anim"
//: }

But this mdl does not get used. Even if I delete the mdl file from the folder iray still renders the image with what I think is a default mdl.
I don't get errors in the log.

Any idea what goes wrong here??

Found warnings and errors in the log txt export (would be nice to get those in the build in log viewer as well).

Code: [Select]
[WARN] <Qt> QLayout: Attempting to add QLayout "" to Alg::GroupWidget "uvTransform0Group", which already has a layout
[WARN] <Qt> QLayout: Attempting to add QLayout "" to Alg::GroupWidget "uvTransform1Group", which already has a layout
[WARN] <Qt> "[DBG WARNING][Iray Service]"    1.0   MDLC   comp warn : E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(58,19): used parameter 'height' marked with anno::unused() annotation
[WARN] <Qt> "[DBG WARNING][Iray Service]"    1.0   MDLC   comp error: E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(290,5): "," expected
[WARN] <Qt> "[DBG WARNING][Iray Service]"    1.0   MDLC   comp error: E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(290,28): no overloaded version of function 'float(bsdf)' matches calling parameters
[WARN] <Qt> "[DBG WARNING][Iray Service]"    1.0   MDLC   comp error: E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(304,9): 'weighted_layer' : cannot convert argument 'layer' from 'float' to 'bsdf'
[ ERR] <Qt> "[DBG ERROR][Iray Service]" E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(290,5): "," expected
[ ERR] <Qt> "[DBG ERROR][Iray Service]" E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(290,28): no overloaded version of function 'float(bsdf)' matches calling parameters
[ ERR] <Qt> "[DBG ERROR][Iray Service]" E:\Ressources\Substance_Painter\shelf\shaders\mdl\skin_metallic_roughness_anim.mdl(304,9): 'weighted_layer' : cannot convert argument 'layer' from 'float' to 'bsdf'
[WARN] <Qt> "[DBG WARNING][Iray Service]" IRay module 'mdl::skin_metallic_roughness_anim' do not exist
[WARN] <Qt> "[DBG WARNING][Iray Service]" "mdl::skin_metallic_roughness_anim::skin_metallic_roughness_anim mdl material wasn't found. Fallback on mdl::alg::materials::physically_metallic_roughness::physically_metallic_roughness"
[WARN] <Qt> "[DBG WARNING][Iray Service]" IRay module 'mdl::skin_metallic_roughness_anim' do not exist
[WARN] <Qt> "[DBG WARNING][Iray Service]" "mdl::skin_metallic_roughness_anim::skin_metallic_roughness_anim mdl material wasn't found. Fallback on mdl::alg::materials::physically_metallic_roughness::physically_metallic_roughness"
[INFO] <Qt> "[DBG INFO][GenericMaterial]" "Creation of the shader pbr-metal-rough_anim successful"
[INFO] <Qt> "[DBG INFO][GenericMaterial]" "Creation of the shader pbr-metal-rough_anim successful"
[INFO] <Qt> "[DBG INFO][GenericMaterial]" "Creation of the shader pbr-metal-rough_anim successful"
[INFO] <Qt> "[DBG INFO][IrayRenderer]" Update material instance
[WARN] <Qt> "[DBG WARNING][Iray Service]" IRay module 'mdl::skin_metallic_roughness_anim' do not exist
[WARN] <Qt> "[DBG WARNING][Iray Service]" "mdl::skin_metallic_roughness_anim::skin_metallic_roughness_anim mdl material wasn't found. Fallback on mdl::alg::materials::physically_metallic_roughness::physically_metallic_roughness"

Main problem seems to be:
Code: [Select]
"mdl::skin_metallic_roughness_anim::skin_metallic_roughness_anim mdl material wasn't found.
I linked the mdl material in the GLSL shader like described in the official documentation, but it seems something is still wrong.

Documentation
Code: [Select]
mdl: define the Iray mdl material to use with the shader. The path syntax is as follow:
mdl::folder1::folder2::mdl_filename::material_name where folder1::folder2::mdl_filename
is the path inside one of your shelf mdl folder to a mdl file and ::material_name is the name
of a material declared inside this mdl file.
(ex: "mdl" : "mdl::alg::materials::physically_metallic_roughness::physically_metallic_roughness")

Would be nice to get support.
Last Edit: May 22, 2021, 01:44:06 am