Exporting displacement maps to Studio :sigh: How?

SnowSultanSnowSultan Posts: 3,638

Before I lose my mind over this for...what, the third time?...can someone PLEASE tell me how to export displacement maps out of Zbrush that don't look like blurry blobs when rendered in Studio?

Please give exact settings if possible. I know to use Multimap Exporter, I know not to FlipV in this case, I know you can use 3 Channel/32 Bit (but Studio doesn't like it?), I've heard you're supposed to set the SubDiv Level in the Multimap Exporter to 1, but that isn't giving any better results than at 5, and the mesh I'm making the displacement maps on is 7.06 million polys so the detail is there. I've watched a number of tutorials that show this procedure for Blender and other software, but the results do not turn out the same in Studio. I've rendered maps that are gray with black and white areas, ones with no gray areas, and some that come out completely black for who knows what reason. I know what I'm doing, but I don't know what I'm overlooking here.

Thanks in advance.

«1

Comments

  • StonemasonStonemason Posts: 1,195

    can you share the displacement(even just a cropped portion of the map would help) map you have?, might be easier to help.

     

    does it work in 3delight but not Iray?

    if in Iray are you subdiving the mesh in DS so there's enough polys for the map to work with?

  • SnowSultanSnowSultan Posts: 3,638

    Thank you very much for replying. I deleted the batch of displacement maps I made, but I will make new ones in the morning here and post a cropped portion. I did not test it in 3Delight, so I'll do that as well with the new ones. As far as Iray, I did try rendering with both real SubD and rendered SubD maxed (3 and 5 I think?). 

  • stefan.humsstefan.hums Posts: 132

    Have you also taken "SubD Displacement Level" into account (Surfaces pane)? Its default value is 0 and may lead to no displacement or something like "just garbage".

  • SnowSultanSnowSultan Posts: 3,638

    Stefan: Yes, I raised both of the settings in the Surfaces to their maximum (2 and 5 I think after double-checking).

    Here is a displacement I made in Zbrush this morning for one of the BETTY Pot sets here that was recently free.It's 32-bit, 3 channel, and looks better than many of the ones I had made yesterday. Nothing I did in DAZ Studio could make this appear on the rendered model. I had SubD all the way up, Displacement value at 1.00, min and max at various levels including -1.00/1.00, 0/1.00, etc, and tried subD surface setting from 1 to 7, nothing worked. In Zbrush, the pot needed to be subdivided 7 times to 4 million polys to get smooth enough detail.

     

     

    displacement32.jpg
    1024 x 1024 - 48K
  • SnowSultanSnowSultan Posts: 3,638
    edited July 2022

    OK, a few more examples.

    After five attempts, this dark displacement map does finally show up in Studio. However, with all settings maxed (subD 7, Displacement value 2.00, with -1.00/1.00 min/max), it still doesn't look right compared to the Zbrush one. Any suggestions that might improve the results are appreciated. Thanks.

    displace.jpg
    1000 x 1155 - 29K
    zbrush_displace.jpg
    664 x 953 - 33K
    studio_displace.jpg
    555 x 854 - 46K
    Post edited by SnowSultan on
  • FenixPhoenixFenixPhoenix Posts: 3,110

    How big is the map? I think you need to export it at a higher resolution and preferably as PNG (as I believe Studio struggles with TIFF files).

  • SnowSultanSnowSultan Posts: 3,638
    edited July 2022

    Sorry, I should have said the original displacement maps were 4K, I just shrunk them to post here. I'll try it in PNG format shortly, thanks.

     

    edit: Zbrush couldn't export directly to PNG, so I resaved the TIFF.  There does seem to be a bit of a difference, but it's not any better quality-wise. 

    Post edited by SnowSultan on
  • Richard HaseltineRichard Haseltine Posts: 102,346

    Some Tiffs would crash Iray for a while, but I think that is fixed (difficult to be sure as most of the affected products were updated). I don't think they are an issue aside from that, indeed Tiffs were the standard before the crashing issue.

    Are you maps 16 bits per channel (ideally 16 bit greyscale)?

  • SnowSultanSnowSultan Posts: 3,638

    Thanks for that information Richard. Yes, I've tried many combinations when rendering these maps out, both 16 and 32 bit. I think this black one that sorta worked was just the default settings with nothing else turned on except Smooth Normals.

  • GhostofMacbethGhostofMacbeth Posts: 1,670

    I sort of gave up on displacement and iray after it caused me to loose many nights of sleep and months of work after a change in how they compute it.

    As far as I can remember subdivide it, set it to render the subdivision at a high level, Tif in 32 bit works best 50% should be mid grey and not adjust anything, crank things up in the surface and hope ...

  • stefan.humsstefan.hums Posts: 132

    SnowSultan said:

    Stefan: Yes, I raised both of the settings in the Surfaces to their maximum (2 and 5 I think after double-checking).

    Here is a displacement I made in Zbrush this morning for one of the BETTY Pot sets here that was recently free.It's 32-bit, 3 channel, and looks better than many of the ones I had made yesterday. Nothing I did in DAZ Studio could make this appear on the rendered model. I had SubD all the way up, Displacement value at 1.00, min and max at various levels including -1.00/1.00, 0/1.00, etc, and tried subD surface setting from 1 to 7, nothing worked. In Zbrush, the pot needed to be subdivided 7 times to 4 million polys to get smooth enough detail.

    Again: Displacement has its own (additional) SubD parameter "SubD Displacement Level" that is below the Maximum Displacement parameter. It is depending on the overal mesh resolution (Render SubD level) but allocates additional subdivision for displacement. Crank it up to 12! Of course this will increase the geometry drastically, but don't worry: Iray limits the additional geometry internally, you will not get billions of polygons eating up all your memory. And it is also not necessary to use insane high overal SubD level (Render SubD) what then WILL cause a huge amount of geometry at all.

    I tried your grey map on a simple plane in base resolution (only 1 quad) - and displacement is rendered in a (for me) normal way with SubD Displacement at 12. Well, it will cause about 8M triangles on this primitive plane surface...

    displacement.jpg
    900 x 900 - 68K
  • Richard HaseltineRichard Haseltine Posts: 102,346

    stefan.hums said:

    SnowSultan said:

    Stefan: Yes, I raised both of the settings in the Surfaces to their maximum (2 and 5 I think after double-checking).

    Here is a displacement I made in Zbrush this morning for one of the BETTY Pot sets here that was recently free.It's 32-bit, 3 channel, and looks better than many of the ones I had made yesterday. Nothing I did in DAZ Studio could make this appear on the rendered model. I had SubD all the way up, Displacement value at 1.00, min and max at various levels including -1.00/1.00, 0/1.00, etc, and tried subD surface setting from 1 to 7, nothing worked. In Zbrush, the pot needed to be subdivided 7 times to 4 million polys to get smooth enough detail.

    Again: Displacement has its own (additional) SubD parameter "SubD Displacement Level" that is below the Maximum Displacement parameter. It is depending on the overal mesh resolution (Render SubD level) but allocates additional subdivision for displacement. Crank it up to 12! Of course this will increase the geometry drastically, but don't worry: Iray limits the additional geometry internally, you will not get billions of polygons eating up all your memory. And it is also not necessary to use insane high overal SubD level (Render SubD) what then WILL cause a huge amount of geometry at all.

    I tried your grey map on a simple plane in base resolution (only 1 quad) - and displacement is rendered in a (for me) normal way with SubD Displacement at 12. Well, it will cause about 8M triangles on this primitive plane surface...

    The surface setting is a minimum value - if the object level is lower then additional divisions will be applied, without smoothing the shape. The actual number of divisions is the highest of the render level on the object and all the surface values. The value may, howevere, be lowered if the total number of polygons is excessive.

  • Richard HaseltineRichard Haseltine Posts: 102,346

    GhostofMacbeth said:

    I sort of gave up on displacement and iray after it caused me to loose many nights of sleep and months of work after a change in how they compute it.

    As far as I can remember subdivide it, set it to render the subdivision at a high level, Tif in 32 bit works best 50% should be mid grey and not adjust anything, crank things up in the surface and hope ...

    Black is the minimum displacement, white is the maximum. Grey has no meaning, it's just halfway between those two values. Min and Max are set in cm.

  • duckbombduckbomb Posts: 585

    I know this isn't what you are asking for, so maybe it isn't helpful, but I'll share anyway just in case.  I have read over and over where people say that displacement maps are a decent replacement for HD morphs, and I just can't agree.  I don't know what you are trying to render, but I personally render extremely high-resolution images for a very particular use case, and I absolutely need the quality that simple definition can provide.  I've never been able to export displacement maps that meet my expectations, and I've stopped trying.

    My "solution" is to simply subdivide the product within DAZ studio, export it out, import it back, export AGAIN, and then use that to create an HD morph.  For something like that vase it would probably work just fine.  For something like rigged characters it's a little less efficient.

    IF you try to use SubD in DAZ and the whole thing falls apart, then I usually change the subdivision settings to "loop" or whatever it is that doesn't actually smooth it out.  THen, when I do the HD modeling in ZBrush I simply smooth out the edges as well quickly to give it a more natural look.  Doing it this way at least keeps the UVs intact so you don't have to re map it.

     

    I know... not the answer to your question, but it's no fun banging your head against a wall so I at least figured I'd share my own opinion on the whole thing.  I'm sure somebody can get high-res displacement to work well, and if that guy put out a tutorial I'd snap it up in a hurry lol.

  • MelissaGTMelissaGT Posts: 2,611

    duckbomb said:

    I know this isn't what you are asking for, so maybe it isn't helpful, but I'll share anyway just in case.  I have read over and over where people say that displacement maps are a decent replacement for HD morphs, and I just can't agree.  I don't know what you are trying to render, but I personally render extremely high-resolution images for a very particular use case, and I absolutely need the quality that simple definition can provide.  I've never been able to export displacement maps that meet my expectations, and I've stopped trying.

    My "solution" is to simply subdivide the product within DAZ studio, export it out, import it back, export AGAIN, and then use that to create an HD morph.  For something like that vase it would probably work just fine.  For something like rigged characters it's a little less efficient.

    IF you try to use SubD in DAZ and the whole thing falls apart, then I usually change the subdivision settings to "loop" or whatever it is that doesn't actually smooth it out.  THen, when I do the HD modeling in ZBrush I simply smooth out the edges as well quickly to give it a more natural look.  Doing it this way at least keeps the UVs intact so you don't have to re map it.

     

    I know... not the answer to your question, but it's no fun banging your head against a wall so I at least figured I'd share my own opinion on the whole thing.  I'm sure somebody can get high-res displacement to work well, and if that guy put out a tutorial I'd snap it up in a hurry lol.

    You can't create an HD morph if the base geometry of the object changes - that is a limitation of the Morph Loader Pro that PA's do not have (they actually can create and import legit HD morphs).  

  • felisfelis Posts: 4,617

    Displacement does work.

    I don't think I have ever used it before.

    This is a plane with a dot-texture, and sudD displacement level of 5.

    Displacement_test.png
    1300 x 731 - 1M
  • SnowSultanSnowSultan Posts: 3,638

    Apologies for not replying, I got very sick out of the blue yesterday morning and this is the first time I've felt up to even turning on my computer since. I'm still in no shape to be experimenting with this stuff, but it might help if someone could just post actual settings and examples of the displacment maps themselves. Should they be mostly gray with black and white areas for depth and height? Did you keep the displacement strength at 1.00 and the min/max at -0.1/0.1? Maybe most importantly, if you exported them from Zbrush, what were your export settings?

    >>Again: Displacement has its own (additional) SubD parameter "SubD Displacement Level" that is below the Maximum Displacement parameter. It is depending on the overal mesh resolution (Render SubD level) but allocates additional subdivision for displacement. Crank it up to 12!<

    I know, but how do you raise that to 12? Turn off limits in the parameter settings (the gear icon)?


    Thanks.

  • felisfelis Posts: 4,617

    Maybe, if you don't mind, you could share the displacement map and for what items it is intended.

    Then others can have a try.

  • stefan.humsstefan.hums Posts: 132
    edited July 2022

    SnowSultan said:

    I know, but how do you raise that to 12? Turn off limits in the parameter settings (the gear icon)?

    The default limit of the Iray Uber shader for SubD Displacement Level is 12, unless the content creator has changed it intentionally for his product. Then you would have to increase this limit again in the parameter settings. Do not use a higher value than 12, it is anyway futile and may cause a crash of Iray or DS.

    As for the displacement values: Defined by the brightness value only because the map is expected as grayscale map, if not it will be converted automatically. Black (brightness value 0) is the maximum negative displacement, white (255) maximum positive displacement, gray (127) is no displacement. These definitions by brightness are relative. The final displacement depends on the Min/Max Displacement value (in mm cm) and the Displacement Strength (multiplier).

    At Displacement Strength 1.00 and the default min/max of -0.10 / 0.10, pure black is 1mm negative, pure white 1mm positive displacement, along the surfaces normals.

    Post edited by stefan.hums on
  • Richard HaseltineRichard Haseltine Posts: 102,346

    stefan.hums said:

    SnowSultan said:

    I know, but how do you raise that to 12? Turn off limits in the parameter settings (the gear icon)?

    The default limit of the Iray Uber shader for SubD Displacement Level is 12, unless the content creator has changed it intentionally for his product. Then you would have to increase this limit again in the parameter settings. Do not use a higher value than 12, it is anyway futile and may cause a crash of Iray or DS.

    As for the displacement values: Defined by the brightness value only because the map is expected as grayscale map, if not it will be converted automatically. Black (brightness value 0) is the maximum negative displacement, white (255) maximum positive displacement, gray (127) is no displacement. These definitions by brightness are relative. The final displacement depends on the Min/Max Displacement value (in mm) and the Displacement Strength (multiplier).

    At Displacement Strength 1.00 and the default min/max of -0.10 / 0.10, pure black is 1mm negative, pure white 1mm positive displacement, along the surfaces normals.

    While mid-grtey is neutral with the default values I think it is best not to imply that it is in any way a special value - only black (Min) and white (Max) are special, grey dispalcement values are simply proportional to their tonal values given the limits.

  • SnowSultanSnowSultan Posts: 3,638
    edited July 2022

    Maybe, if you don't mind, you could share the displacement map and for what items it is intended.

    No, I've experimented quite enough and I do not have a specific displacement map in mind. If people claim to know that this works, then simply post the values, the export settings, and whether the map should be mostly gray or not. This shouldn't be some big secret. If possible, show it on some sort ot more complex or rounded mesh and not a plane; I think there's going to be a big difference in quality.

    Post edited by SnowSultan on
  • stefan.humsstefan.hums Posts: 132

    Richard Haseltine said:

    While mid-grtey is neutral with the default values I think it is best not to imply that it is in any way a special value - only black (Min) and white (Max) are special, grey dispalcement values are simply proportional to their tonal values given the limits.

    Of course, you're right. My fault, I should have mentioned that mid-grey is neutral only if min/max displacement is symmetrical.

    With asymmetrical min/max values, mid-grey shifts to the arithmetic mean. For example min is -1 and max is +3, then mid-grey would cause displacement +1. Min -3 and max +1, then it would be -1. Or min +5 and max +15 --> results in +10 for mid-grey.

     

    Btw I found a very strange behaviour of Iray right now: If you have asymmetrical limits and min displacement is "more negative" than its positive counterpart (for example min -3 and max +1), displacement shifts to more negative (like expected) - BUT it will be clipped off symmetrical to max! In my example, no more displacement below -1, it stops there immediately as if there would be a barrier for the produced geometry! No warning/error in the log file, except of the usual complain that my map produces too many geometry at SubD 12 for my 1 square meter plane. I guess this must be a bug in Iray or DS.

  • MelissaGTMelissaGT Posts: 2,611
    edited July 2022

    I've had the best luck using a neutral grey background for displacement maps. Neutral grey would indicate "flat" no change. Then darker would indicate down and lighter would indicate up in terms of which way the map displaces. You would have to play with the minimum and maximum displacement to your own needs, but typically you would start off with a strength of say .5 or 1 and then minimum displacement of -.25 (or around in there) and maximum displacement of .25 (or around in there) and then just tweak around with it til you get what you're looking for. It's a matter of just playing with all the settings, including the SubD Displacement (I usually start with 6 on this one). I know that doesn't help, but there really is no magic setting that works for all maps. 

    If you have a displacement map where you do not want any "down" direction, then you can start with a 100% black map with all detail being lighter shades of grey/white...which would all indicate "up". At that point, you would have your minimum displacement set to 0. 

    I hope that helps! I use displacement a lot for building custom skin features like scars and scarrification and I use it a lot on clothing too in order to take that "flat tube" clothing we all hate and give it some help with seams, etc. 

    Post edited by MelissaGT on
  • SnowSultanSnowSultan Posts: 3,638

    Thanks Melissa, that is actually how I thought displacement maps worked all this time; using ones with mostly gray where the white and black determine height and depth. I did this render with the displacement set to 12 in the surface parameter though and it still doesn't look anywhere as accurate or clean as the Zbrush one. In fact, it pretty much looks the same at every subD level after 7.

    Do you create displacements in Zbrush? If you do, would you mind sharing your export settings? I just want to make sure I'm not doing anything wrong on that end.

    sub12.jpg
    1486 x 1234 - 375K
  • stefan.humsstefan.hums Posts: 132

    SnowSultan said:

    Maybe, if you don't mind, you could share the displacement map and for what items it is intended.

    No, I've experimented quite enough and I do not have a specific displacement map in mind. If people claim to know that this works, then simply post the values, the export settings, and whether the map should be mostly gray or not. This shouldn't be some big secret. If possible, show it on some sort ot more complex or rounded mesh and not a plane; I think there's going to be a big difference in quality.

    Well, if you don't even wanna tell us at least the product/item with what you're working... I'm sure, no one here has a working crystal ball, so no one can have at least a look at that product without knowing what it is and whether it maybe has itself an issue with displacement.

    I only can tell you THAT displacement works and does its job in a normal way.

    And for showing you, a very simple displacement map attached, 2k resolution, 8 bit. And made in a simple tool (IrfanView). Renders with using a simple sphere (1 meter, 12 segments, 24 sides) - not subdivided!

    For displacement, default Displacement Strength 1.00, min/max -1.00 / 1.00 for the first 3 renders, min/max -4.00 / 4.00 for the other 3. SubD Displacement used: 5, 8 and 12.

    And the last 2 are for what I already have used displacement: grass. A 1x1m plane (instanced) with only a grass texture, in the displacement channel a 4k noise map. And using displacement values between 1 and 20 for the height. Absolutely no problems with that.

    As for Zbrush: I can't help you. But if Zbrush exports the map like your small grey example above, you also shouldn't have problems to render it. Export the map at least in 2k resolution, 4k might be better.

    dptest.png
    2048 x 2048 - 29K
    displacement works (1) SubD DLevel 5.jpg
    900 x 900 - 73K
    displacement works (2) SubD DLevel 8.jpg
    900 x 900 - 73K
    displacement works (3) SubD DLevel 12.jpg
    900 x 900 - 73K
    displacement works (4) SubD DLevel 5 dv4.jpg
    900 x 900 - 79K
    displacement works (5) SubD DLevel 8 dv4.jpg
    900 x 900 - 78K
    displacement works (6) SubD DLevel 12 dv4.jpg
    900 x 900 - 78K
    displacement grass 1.jpg
    900 x 900 - 353K
    displacement grass 2.jpg
    900 x 900 - 240K
  • SnowSultanSnowSultan Posts: 3,638

    I didn't mean to imply that displacement does not work, but my making random displacement maps that may or may not work and then others saying "it works for me" doesn't help. I wanted actual values and examples, and thank you for providing some.

  • felisfelis Posts: 4,617

    This is a crude attempt on Betty AP 04 Vase 05.

    I painted the displacement in 2D in an image editor.

    The displacement is set to -1 to +1 (cm) with displacement subD at 5.

    Betty_displacement.png
    1300 x 731 - 2M
  • jestmartjestmart Posts: 4,449

    Displacement in Iray is very dependent on the uniformity of the mesh's polygons.  A long cylinder that is made of long polygons will not diplace well no matter how high you set the sub-d.  Add edge loops so the polygons are mostly square and you will get the result you hope.

  • Richard HaseltineRichard Haseltine Posts: 102,346
    edited July 2022

    Generally you want the map to have at least some black and white values, otherwise you are throwing away some of the potential detail (in a case like the Daz humans, where there are multiple maps across the figure, you may have black or white only on some wiith the most extreme dispalcement in order to have the same settings across all surfaces but the general point remains that you don't want to waste map values when you could use them and get smoother transitions).

    Personally I would say that the Min/Max values (which are in cm) should be used and strength should stay at 100% for the base material (it might be adjusted for specific needs once the maps were set up), otherwise the displacement values change their meaning.

    Post edited by Richard Haseltine on
  • Richard HaseltineRichard Haseltine Posts: 102,346

    stefan.hums said:

    Btw I found a very strange behaviour of Iray right now: If you have asymmetrical limits and min displacement is "more negative" than its positive counterpart (for example min -3 and max +1), displacement shifts to more negative (like expected) - BUT it will be clipped off symmetrical to max! In my example, no more displacement below -1, it stops there immediately as if there would be a barrier for the produced geometry! No warning/error in the log file, except of the usual complain that my map produces too many geometry at SubD 12 for my 1 square meter plane. I guess this must be a bug in Iray or DS.

    Yes, this came up some years back - I'm sure it was reported but a fresh report might be useful (sorry, I hadn't looked for ages to see if it was fixed).

Sign In or Register to comment.