"Z Handcuffed" Material Issue

Issue #915 resolved
Midnight Arrow created an issue

I imported Zeddicus’s “Z Handcuffed” handcuffs into Blender but the material had a pretty glaring – or not glaring – issue. It uses just an Iray Uber Metal shader and the imported bump is way too strong. It comes in at 0.012, but according to my testing is needs to be 0.00012 to match the Iray view, so it’s off by 100x. With such extreme bump it removes all the shine completely and looks ugly.

Iray:

Blender:

Blender (bump set to 0.00012):

Comments (17)

  1. Midnight Arrow reporter

    The lighting isn’t the problem. Here’s an Iray pic with the same HDRI. The cuff on the right has a bump of 1.0. The cuff on the left I manually turned it up to 100.0 which gets the same problem seen in Blender. For whatever reason the bump distance isn’t being scaled down to account for the different in units between Blender and Daz Studio.

  2. Alessandro Padovani

    In iray the bump distance depends on the pixel density, that sucks if you ask me but that it is. See #433.

    edit. If they didn’t change anything in a new version of iray I mean. And if that’s the case then it’ll break all the daz content. I keep daz studio 4.15 because 4.20 breaks some materials and this is a known issue at the daz forum.

    edit. Also eevee treats the bump differently than cycles that’s why you have a bump correction in the general options that defaults to 1 for cycles.

    https://docs.blender.org/manual/en/latest/render/eevee/materials/nodes_support.html

  3. Midnight Arrow reporter

    I see. As discussed in that issue, is there now a modifier to scale different bump values by a common scalar?

    edit I keep 4.15 too since I have no reason to use Daz for anything besides exporting.

    edit I see now the Bump Factor in the global settings, but if the bump depends on an individual mesh’s pixel density shouldn’t it be an import option?

  4. Alessandro Padovani

    The bump factor in the global settings was intended to be changed if we import for eevee. Otherwise it is automatically computed from the mesh area you don’t need to change it. The new version of eevee in blender 3 seems more precise though and we may not need it anymore. But yes Thomas it may make sense to keep the bump factor in the import options, with a tooltip that it may be necessary for eevee.

  5. Alessandro Padovani

    update. important.

    @Midnight I can confirm that the bump for the z handcuffs is way off. If I follow the equation in #433 the bump is 0.054 mm while the plugin computes 12 mm. I have to do some tests to understand if the error is limited to this item and why. It is unlikely that Thomas has this specific item to test.

    material area [mm2] = sum of the surfaces using the bump texture
    pixel density [pix/mm2] = texture width * height * horizontal tiles * vertical tiles / material area [mm2]
    bump height [mm] = 3 / sqrt(pixel density [pix/mm2])
    

  6. Thomas Larsson repo owner

    It looks like no scale factor in the code that computes the material area, so it is given in m^2 rather than mm^2. That would change the height by a factor sqrt(1000) = 31.6 rather than 12/0.054 = 222.2 though.

  7. Alessandro Padovani

    Thomas the G8F maps, the magus outfit, and the other tests I did look good so it can’t be that the surface is in m^2, or you compensate for that someway. Also the scale factor would be 1000*1000 for m^2 to mm^2 so the sqrt is 1000 not 31.6, unless I miss something that’s entirely possible.

    It seems it is an issue with this specific item I’ll try to understand why. Below the computation with 3d-print, it’s not 0.054 I was wrong because I didn’t consider all the surfaces, but it’s 0.084 so the order of magnitude is the same.

    # z handcuffs
    area = 29738 mm2
    density = 512*512 * 12*12 / 29738 = 1269 pixel/mm2
    bump = 3 / sqrt(1269) = 0.0842 mm
    

  8. Alessandro Padovani

    update. may be solution.

    It may be the plugin doesn’t consider the tiles as noted in the equations. That is, 0.0842 * 12*12 = 12.2 mm that’s about what the plugin computes. Will do more tests and upload a test scene for that.

    edit. note. Please note that in the equation the material area is one per bump texture, while the bump height is one per material. That is, the pixel density may differ depending on the tiles.

  9. Midnight Arrow reporter

    Another thing I noticed is that the mapping node uses “Texture” type instead of “Point” type so the tiling has to be set at 1.0 / 12.0 rather than setting it to 12.0 directly. Could it be the reason why the bump is coming out wrong? The algorithm expects 12.0 but it gets 1.0 / 12.0 instead? I think for readability sake the mapping node should be set at “Point” so we don’t have to invert calculations and can just plug the number of tiles we want directly.

  10. Alessandro Padovani

    Ok I got to make a simple test scene in daz studio. It’s a torus with a couple materials using the same bump map but different tiles. Below the equations and results for each material.

    # bump test scene
    area = 3778255 mm2
    
    default density = 256*256 * 5*1 / 3778255 = 0.0867 pixel/mm2
    default bump = 3 / sqrt(0.0867) = 10.2 mm
    
    blue density = 256*256 * 10*1 / 3778255 = 0.173 pixel/mm2
    blue bump = 3 / sqrt(0.173) = 7.2 mm
    
    red density = 256*256 * 2*1 / 3778255 = 0.0347 pixel/mm2
    red bump = 3 / sqrt(0.0347) = 16.1 mm
    

    Then below the render in iray then in cycles where the bump is off. Then the fix with the values above that are not computed correctly by the plugin.

  11. Alessandro Padovani

    @Midnight No it makes sense to use the “Texture“ type since we’re computing a texture. And the tile value is correctly computed by the plugin it’s only the bump value that’s off.

  12. Thomas Larsson repo owner

    Fixed in last commit. The pixel density was multiplied with the scale instead of the number of tiles = 1/scale.

  13. Alessandro Padovani

    Thank you Thomas for the fix.

    Commit 8e73da2 works fine here. Also it seems that in blender 3 eevee is good enough with bump factor = 1 same as cycles. If Midnight has nothing to add we may mark as resolved.

  14. Log in to comment