yaluxplug (Daz to LuxCoreRender 2.5 plugin): Help Needed
Posted: Thu Jun 24, 2021 1:00 am
Hi. I am updating an old Daz To LuxRender plugin I wrote in 2015 to work with LuxCoreRender 2.5 and the latest Daz Studio assets (Genesis 8.1 and PBRSkin/IrayUber shaders). I know that the RealityDS plugin is now open-sourced and have looked through the source code a little bit. I'll try to incorporate anything which is done better from it. However, I wrote my plugin back in 2015 to do a few things that RealityDS did not offer: native Daz Render Engine support (with potentially interactive rendering) and integrated network rendering. The network rendering code needs to be updated for LuxCoreRender, but I have most of my LXS export code now converted to CFG/SCN format. However, I'm having some trouble getting a few things to work correctly: (1) bumpmap strength scaling, (2) material mixing of glossy2 + metal2 materials, (3) UV-space flipping of IBL/HDR lighting file, (4) normal map usage without bump maps create black textures. I have little to no experience using LuxCoreRender, so I'm sure some of these issues are related to user error.
Regarding bumpmap strength scaling: I have been trying to use the texture type:mix to scale down the strength of bumpmap files. I am setting scene.textures.<>.texture1 to constfloat value of 0.5, and setting scene.textures.<>.texture2 to the original bumpmap. Then I am setting the scene.textures.<>.amount to the desired bumpmap strength. However, It does not seem that the amount is having any effect on the actual render. In my experience, most Daz Studio bumpmap textures need to be scaled down by at least 100x for LuxRender.
Regarding material mixing of glossy2 + metal2 materials: whenever I try mix glossy2 and metal2 materials together in my export code, I get several visual artifacts including random unlit triangles and altered position of scene lighting.
The issue related to IBL lighting is that I need to flip the V coordinate space of HDR textures so that they properly align to Iray rendering behavior. This actually seems to be a global issue with almost all textures from Daz to LuxRender; I am using UV scaling of (1, -1) to fix this for most textures, but I don't know if there is an equivalent feature to flip the coordinate space on an HDR image. If not, I can just write out a temporary HDR file with flipped coordinates, so this is not a big deal.
Finally, whenever a specify a normal map (with glossy2) using scene.materials.<>.normaltex but do not specify a bump texture with scene.materials.<>.bumptex, the entire material is rendered as a black space. Also, the Convergence is always at 0.000000% and never increases. I have gotten around this problem by inserting a constfloat1 texture as a "dummy" bumptex.
Here are some relevant images and the corresponding scene files:
Iray Reference:
test-102a-yaluxplug.jpg (no bumpmaps, no material mixing):
cfg file: https://mod-place.com/perm/test-102-yaluxplug.cfg
scn file: https://mod-place.com/perm/test-102a-yaluxplug.scn
test-102b-yaluxplug.jpg (bumpmaps enabled):
scn file: https://mod-place.com/perm/test-102b-yaluxplug.scn
test-102c-yaluxplug.jpg (glossy2+metal2 mixing):
scn file: https://mod-place.com/perm/test-102c-yaluxplug.scn
Here is a second set of images:
Iray Reference:
test-103a-yaluxplug.jpg (no bumpmaps, no material mixing):
cfg file: https://mod-place.com/perm/test-103-yaluxplug.cfg
scn file: https://mod-place.com/perm/test-103a-yaluxplug.scn
test-103b-yaluxplug.jpg (bumpmaps enabled):
scn file: https://mod-place.com/perm/test-103b-yaluxplug.scn
test-103c-yaluxplug.jpg (glossy2+metal2 mixing):
scn file: https://mod-place.com/perm/test-103c-yaluxplug.scn
test-103d-yaluxplug.jpg (bumpmap AND glossy2+metal2 mixing enabled):
scn file: https://mod-place.com/perm/test-103d-yaluxplug.scn
Here is the black texture / normalmap issue:
scn file: https://mod-place.com/perm/test-104-yaluxplug.scn
Once I am able to solve these issues, I will work on a few unimplemented features to reach parity with the Daz Iray renderer: Dual Lobe Specular Reflectivity, SSS/Translucency/Transmission, and Top Coat effects. Currently, I'm just blending the two specular lobe data together, but I will try to apply the second specular roughness values as a glossycoating material. I will try to use glossycoating to do the same with Top Coat color, reflection, bump. I have not looked into SSS/Translucency too much, but I'll try to use Volumes to reproduce those effects. In the future, I will try to look into using the Disney shader to replace all of the above effects.
Please let me know if you have any ideas as to what could be causing these issues or if you have any advice or comments. Thanks!
BTW, here is the github link: https://github.com/danielbui78/yaluxplug
and the main thread on the Daz Forums: https://www.daz3d.com/forums/discussion ... gin#latest
Regarding bumpmap strength scaling: I have been trying to use the texture type:mix to scale down the strength of bumpmap files. I am setting scene.textures.<>.texture1 to constfloat value of 0.5, and setting scene.textures.<>.texture2 to the original bumpmap. Then I am setting the scene.textures.<>.amount to the desired bumpmap strength. However, It does not seem that the amount is having any effect on the actual render. In my experience, most Daz Studio bumpmap textures need to be scaled down by at least 100x for LuxRender.
Regarding material mixing of glossy2 + metal2 materials: whenever I try mix glossy2 and metal2 materials together in my export code, I get several visual artifacts including random unlit triangles and altered position of scene lighting.
The issue related to IBL lighting is that I need to flip the V coordinate space of HDR textures so that they properly align to Iray rendering behavior. This actually seems to be a global issue with almost all textures from Daz to LuxRender; I am using UV scaling of (1, -1) to fix this for most textures, but I don't know if there is an equivalent feature to flip the coordinate space on an HDR image. If not, I can just write out a temporary HDR file with flipped coordinates, so this is not a big deal.
Finally, whenever a specify a normal map (with glossy2) using scene.materials.<>.normaltex but do not specify a bump texture with scene.materials.<>.bumptex, the entire material is rendered as a black space. Also, the Convergence is always at 0.000000% and never increases. I have gotten around this problem by inserting a constfloat1 texture as a "dummy" bumptex.
Here are some relevant images and the corresponding scene files:
Iray Reference:
test-102a-yaluxplug.jpg (no bumpmaps, no material mixing):
cfg file: https://mod-place.com/perm/test-102-yaluxplug.cfg
scn file: https://mod-place.com/perm/test-102a-yaluxplug.scn
test-102b-yaluxplug.jpg (bumpmaps enabled):
scn file: https://mod-place.com/perm/test-102b-yaluxplug.scn
test-102c-yaluxplug.jpg (glossy2+metal2 mixing):
scn file: https://mod-place.com/perm/test-102c-yaluxplug.scn
Here is a second set of images:
Iray Reference:
test-103a-yaluxplug.jpg (no bumpmaps, no material mixing):
cfg file: https://mod-place.com/perm/test-103-yaluxplug.cfg
scn file: https://mod-place.com/perm/test-103a-yaluxplug.scn
test-103b-yaluxplug.jpg (bumpmaps enabled):
scn file: https://mod-place.com/perm/test-103b-yaluxplug.scn
test-103c-yaluxplug.jpg (glossy2+metal2 mixing):
scn file: https://mod-place.com/perm/test-103c-yaluxplug.scn
test-103d-yaluxplug.jpg (bumpmap AND glossy2+metal2 mixing enabled):
scn file: https://mod-place.com/perm/test-103d-yaluxplug.scn
Here is the black texture / normalmap issue:
scn file: https://mod-place.com/perm/test-104-yaluxplug.scn
Once I am able to solve these issues, I will work on a few unimplemented features to reach parity with the Daz Iray renderer: Dual Lobe Specular Reflectivity, SSS/Translucency/Transmission, and Top Coat effects. Currently, I'm just blending the two specular lobe data together, but I will try to apply the second specular roughness values as a glossycoating material. I will try to use glossycoating to do the same with Top Coat color, reflection, bump. I have not looked into SSS/Translucency too much, but I'll try to use Volumes to reproduce those effects. In the future, I will try to look into using the Disney shader to replace all of the above effects.
Please let me know if you have any ideas as to what could be causing these issues or if you have any advice or comments. Thanks!
BTW, here is the github link: https://github.com/danielbui78/yaluxplug
and the main thread on the Daz Forums: https://www.daz3d.com/forums/discussion ... gin#latest