Displacement in DS?

DisparateDreamerDisparateDreamer Posts: 2,511
edited December 1969 in The Commons

I thought Daz displacement maps needed to be in terms of gray... but my tests are showing better (correct) results using the black/white disp maps from poser than the DS displacement maps....

did this function change from older versions of DS in 4.6?

Please someone, clarify?

What color on a displacement map in Daz is NEUTRAL (neither positive or negative) displacement?
Thanks, i'm a bit confused T_T

Comments

  • SzarkSzark Posts: 10,634
    edited August 2013

    Nope no change and no they don't NEED to be Gray scale but greyscale is better in DS.

    128,128,128 Grey is neutral this is where the + and - settings come in to play.

    Poser Black is generally flat in Poser, no change at defualt but using the node system you can turn Black in to a negative.

    Post edited by Szark on
  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    Szark said:
    Nope no change and no they don't NEED to be Gray scale but greyscale is better in DS.

    128,128,128 Grey is neutral this is where the + and - settings come in to play.

    Poser Black is generally flat in Poser, no change at defualt but using the node system you can turn Black in to a negative.

    Well that's weird, because at neutral gray if I turn on displacement, not just the white areas are displacing up, the parts that are 128, 128 and 128 gray are also raising.... definitely NOT neutral behavior!!! SO FRUSTRATED

  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    Okay, when the gray map is used, at a zero negative bump, it displaces UP. WHY?

    If i put a negative displacement equal to the positive displacement, the gray stays where it belongs.
    That doesnt' really make any sense.

    gray should be no displacement either way, right? positive should only affect the areas that are lighter than the neutral gray.

    So frustrated!

    if I use a poser displacement map, the white displaces up as it should. the black stays put at 0 negative, and displaces down at negative numbers.

    Sounds to me that the poser maps are working correctly in DS and ds maps are not.

  • SzarkSzark Posts: 10,634
    edited December 1969

    I am guessing that the displacement maps don't have a Gamma of 1 but a Gamma of 2.2. Try this in DS4.6 in the Surfaces Pane clcik on the small thumb of the displacement map and choose Image Editor and see what the Gamma is set to. If On zero try adjusting it to 1.0 and try again with Gamma Correction in the Render Settings turned ON.

  • Zev0Zev0 Posts: 7,096
    edited August 2013

    Adjust the min and max vaues. Max is how high it will be( stand out) and min is how indented it will be. And I prefer Daz displacements because its based off neutral, so you have more control. Also check to see if the base on your displacement map is 128 128 128, sometimes they do deviate depending on PA and their preference.

    Post edited by Zev0 on
  • ServantServant Posts: 759
    edited December 1969

    Okay, when the gray map is used, at a zero negative bump, it displaces UP. WHY?

    If i put a negative displacement equal to the positive displacement, the gray stays where it belongs.
    That doesnt' really make any sense.

    gray should be no displacement either way, right? positive should only affect the areas that are lighter than the neutral gray.

    So frustrated!

    if I use a poser displacement map, the white displaces up as it should. the black stays put at 0 negative, and displaces down at negative numbers.

    Sounds to me that the poser maps are working correctly in DS and ds maps are not.

    AFAIK, with DS some of the shading dials are done in reverse. This is why Opacity is dialed down from 100%, if you want an area to look transparent. It might be the same for Displacement maps.

  • SzarkSzark Posts: 10,634
    edited December 1969

    Opague is not Transparent hence why it is set to 100%.

  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited August 2013

    Ok, someone explained this very strange Daz gray map math to me.....

    if the maps are 128-128-128 gray (or otherwise known as 50% gray in GIMP), for the gray to actually be 0 displacement, the negative displacement number has to balance out the positive displacement. So if the positive displacement is .1, the negative must be -0.1.

    All I can say is, what a pain in the ARSE.

    Poser maps are so much easier to use. And I have never used poser but they make SENSE and can be used without math.....

    also, the gamma is set to 1

    Post edited by DisparateDreamer on
  • Richard HaseltineRichard Haseltine Posts: 102,344
    edited August 2013

    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    Post edited by Richard Haseltine on
  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

  • ChoholeChohole Posts: 33,604
    edited August 2013

    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

    In poser. yes white parts on a black background would give you displacement. Rather a harsh, simplified displacement. You still need shades from white through grey to give a nice displacement,

    In DS white and black would give you a two way displacement, with the black sinking and the white raising the mesh.

    This is the main difference in the way Poser and DS handle displacement. DS by default does two way displacement using the mid grey as the flat (or ground) level and darker shades lowering below this and lighter shades raising. Poser, by default only does one way displacement, with the lighter shades raising up from the black flat level. This is why Poser needs the negative node plugged in, to simulate the two way displacement.

    Post edited by Chohole on
  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    chohole said:
    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

    In poser. yes white parts on a black background would give you displacement. Rather a harsh, simplified displacement. You still need shades from white through grey to give a nice displacement,

    In DS white and black would give you a two way displacement, with the black sinking and the white raising the mesh.

    This is the main difference in the way Poser and DS handle displacement. DS by default does two way displacement using the mid grey as the flat (or ground) level and darker shades lowering below this and lighter shades raising. Poser, by default only does one way displacement, with the lighter shades raising up from the black flat level. This is why Poser needs the negative node plugged in, to simulate the two way displacement.

    That sounds backwards to me- gray in DS does not stay "flat, groundlevel" unless the NEGATIVE DISPLACEMENT IS dialed to equal the the positive displacement! that's counter intuitive in my mind. to be a negative number, just to NOT MOVE? makes no sense! ZERO would be null/flat/not moving! Negative anything should be negative displacement.. That's why this doesn't make a bit of sense to me....

  • ChoholeChohole Posts: 33,604
    edited December 1969

    This is a bit difficult for me to demonstrate, as I don't use DS, only Poser. However, this dress is a simple model, with no folds modelled into the blouse part. I wanted to show and embroidered waistline, as in a dirndl skirt. So I simulated it with displacement on the bottom of the blouse.

    I show a close up of part of the displacement map, and then how it looks in poser on the clay model, with noe negative node. As you can see it gives a very soft displacement. As the displcemet map was optimised to work ion DS it would actually give much more defined displacement in DS, but I cannot demonstrate that.

    sky_dirncl_disp_demo.png
    600 x 600 - 198K
    displce_map_demo.jpg
    216 x 216 - 70K
  • ChoholeChohole Posts: 33,604
    edited December 1969

    and a quick render to show how it looks with the texture applied, again in poser.

    displ_demo_colour.png
    629 x 642 - 454K
  • KickAir 8PKickAir 8P Posts: 1,865
    edited December 1969

    chohole said:
    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

    In poser. yes white parts on a black background would give you displacement. Rather a harsh, simplified displacement. You still need shades from white through grey to give a nice displacement,

    In DS white and black would give you a two way displacement, with the black sinking and the white raising the mesh.

    This is the main difference in the way Poser and DS handle displacement. DS by default does two way displacement using the mid grey as the flat (or ground) level and darker shades lowering below this and lighter shades raising. Poser, by default only does one way displacement, with the lighter shades raising up from the black flat level. This is why Poser needs the negative node plugged in, to simulate the two way displacement.

    That sounds backwards to me- gray in DS does not stay "flat, groundlevel" unless the NEGATIVE DISPLACEMENT IS dialed to equal the the positive displacement! that's counter intuitive in my mind. to be a negative number, just to NOT MOVE? makes no sense! ZERO would be null/flat/not moving! Negative anything should be negative displacement.. That's why this doesn't make a bit of sense to me....
    Hmmmm, this is making sense to me: if you put a paperclip in the middle (zero point) of a rubber band (128-128-128 gray) stretched between a post at 1 and a post at -1, then when you move the post at 1 to 3 the paperclip won't be in the middle anymore. For the paperclip (128-128-128 gray) to stay at the zero point the posts have to be equally far away from that point.

    This feels right to me, but I've always been a DAZ|Studio user -- I've never used Poser-style displacement.

  • ChoholeChohole Posts: 33,604
    edited August 2013

    I just asked Neil to run a similar thing using the same displacement map in DS 4.6, I think you cann se how much better the displacement shows in DS.

    Dirndl.jpg
    800 x 800 - 186K
    Post edited by Chohole on
  • Richard HaseltineRichard Haseltine Posts: 102,344
    edited December 1969

    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

    If you want only positive displacement then paint the map white for up, black for flat, and use shades of grey between. Then set displacement min to 0, and max to the top height you want.

  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    Grey isn't defined as anything - black give the minimum value, whatever that is, and white gives the maximum value, whatever that is, with the shades of grey spread between. If min and max aren't equal and opposite then grey won't be in the middle. There's no reason you should set min to 10, max to 5 and have the surface project out less for light than for dark, with all parts over the default position, though it would be an odd thing to do.

    You can of course do exactly the same in Poser by plugging a maths node in to subtract or add from the map's value, or even to multiply it by -0.5 and add 1 to get the weird arrangement I outline above.

    I just don't understand why it works that way... so confusing. if i just want white/whitish parts of the map to displace up, and the rest not displace at at all, its simpler to paint the white parts on a black map, isn't it?

    If you want only positive displacement then paint the map white for up, black for flat, and use shades of grey between. Then set displacement min to 0, and max to the top height you want.

    that's what i was thinking, yeah. the gray maps just make it harder to work with. For the record, I've been using DS for years, but most of the time have been using Poser maps in DS- in my mind they're easier to work with than DS maps.

  • SimonJMSimonJM Posts: 5,997
    edited December 1969

    A while back I started writing a 'how-to' for bump/displacement in Daz Studio and I have to admit I got confused over how it worked. For a start there is the issue of just what is the 'ground-state' of grey that gives no effect? I have seen both 127, 127, 127 and 128, 128, 128 mentioned. But again, we have the problem of that the 0 to 255 scale (256 values) does NOT have a integer mid-point; half way between 0 and 255 is 127.5. The min and max displacements did not seem to function as suggested - how I thought it all worked was that black was full displacement 'inward' and white was full displacement 'outward. How much effect that displacement actually has is controlled by the Min and Max settings, so you could limit the inward displacement to just, say, 0.1cm but have the outward displacement be to 5 cm and the grey scale of the displacement map would be suitably 'tweaked'. Thus something set to displace inward (such as an engraving) by 0.05cm would be defined by a level of grey half way between the 128 midpoint and the 255 full black. If you than decided that the engravings needed to be deeper you could just adjust the Min setting up to, for example, 0.2cm and have the inward displacement effect be, in effect, twice as effective - all without affecting anything else.

    But that did not seem to happen with the simple trials I did - the basi DAZ primitive plane I was using would displace itself upward if I applied a displacement map that was mostly the level grey (128) and had a few places where positive or negative displacement were defined. As things were happening against how I thought I understood them to be I stopped the 'how-to'! :)

  • cwichuracwichura Posts: 1,042
    edited August 2013

    The displacement map simply represents the continuum between the min displacement value and max displacement value. It helps if you think of it as a range of floating point values from 0 to 1, rather than grayscale values of 0 to 255. E.g., 128 is .5, and 255 is 1.0. 0 is, of course, 0. Now the displacement of a given pixel is defined as:

    float(uv) * displacement map strength * ((max-min) + min)

    You can't just say '128' is no displacement. That's only true when min and max are equal opposites, as already stated. There is nothing 'wrong' with using 0 for min and treating the map like a 'poser map'. Studio just gives you an easier way to do inverse displacement than Poser does 'out of the box' is all.

    Does Studio support .exr files yet? If so, with EXRs for displacement and/or bump maps, you are supplying floats directly and don't have to worry about the integer->float resolution of 8 or 16bit integer input files. LuxRender lets you use .exr's, but truth be told, the imprecision of the integer->float conversion is usually not an issue in my experience.

    Post edited by cwichura on
  • SimonJMSimonJM Posts: 5,997
    edited December 1969

    That'd certainly explain things! :)

  • DisparateDreamerDisparateDreamer Posts: 2,511
    edited December 1969

    cwichura said:
    The displacement map simply represents the continuum between the min displacement value and max displacement value. It helps if you think of it as a range of floating point values from 0 to 1, rather than grayscale values of 0 to 255. E.g., 128 is .5, and 255 is 1.0. 0 is, of course, 0. Now the displacement of a given pixel is defined as:

    float(uv) * displacement map strength * ((max-min) + min)

    You can't just say '128' is no displacement. That's only true when min and max are equal opposites, as already stated. There is nothing 'wrong' with using 0 for min and treating the map like a 'poser map'. Studio just gives you an easier way to do inverse displacement than Poser does 'out of the box' is all.

    Does Studio support .exr files yet? If so, with EXRs for displacement and/or bump maps, you are supplying floats directly and don't have to worry about the integer->float resolution of 8 or 16bit integer input files. LuxRender lets you use .exr's, but truth be told, the imprecision of the integer->float conversion is usually not an issue in my experience.

    It's not really "easier" if you have a map that has a base color of, say, 113, and you're trying to figure out what the heck the negative displacement should be to keep that base surface from elevating! if its not neutral gray, and the positive displacement is 1, you can't just put a -1 for the negative displacement, because the gray isn't neutral. You'll still have a floating base! that's why its so darn complicated and painful to work with. It's not "easy" at all. Not when it has complicated math just to make simple displacements work. :(

  • JaderailJaderail Posts: 0
    edited December 1969

    One 128,128,128 as dead zero is ONLY dead zero with Displacement ON AND set to a Value above Zero. 100% is right for Test purposes and Min set -0.1 and Max at .1 that is DAZ Studio Default Displacement. IF you get any Displacement with those values YOUR 2D art program Might SAY 128,128,128 as Values but is NOT saving that as the Value in the DATA code of the JPG file. All 2D art programs are not created equal. In today's 2D prg's Default is 64K Color at 24 bit. Just one float point error at Color map reduction and 128,128,128 is really 128,128,128.2 or so. and will show in DS.

  • Richard HaseltineRichard Haseltine Posts: 102,344
    edited August 2013

    Never mind, I missed some replies that already covered what I was saying.

    Post edited by Richard Haseltine on
  • Richard HaseltineRichard Haseltine Posts: 102,344
    edited December 1969

    Jaderail said:
    One 128,128,128 as dead zero is ONLY dead zero with Displacement ON AND set to a Value above Zero. 100% is right for Test purposes and Min set -0.1 and Max at .1 that is DAZ Studio Default Displacement. IF you get any Displacement with those values YOUR 2D art program Might SAY 128,128,128 as Values but is NOT saving that as the Value in the DATA code of the JPG file. All 2D art programs are not created equal. In today's 2D prg's Default is 64K Color at 24 bit. Just one float point error at Color map reduction and 128,128,128 is really 128,128,128.2 or so. and will show in DS.

    I'm not sure what you mean. As noted above, neither [128, 128, 128] nor [127, 127, 127] is an exact zero though if the displacement is turned up enough for this to show you should be working with a 16-bit greyscale anyway or you will get horrible posterisation/staircasing.

    And a jpg won't store non-integer values for the colours - it isn't a floating point format. It will approximate the saved data (which is what makes it a lossy format) but not in that way.

  • Richard HaseltineRichard Haseltine Posts: 102,344
    edited December 1969

    It's not really "easier" if you have a map that has a base color of, say, 113, and you're trying to figure out what the heck the negative displacement should be to keep that base surface from elevating! if its not neutral gray, and the positive displacement is 1, you can't just put a -1 for the negative displacement, because the gray isn't neutral. You'll still have a floating base! that's why its so darn complicated and painful to work with. It's not "easy" at all. Not when it has complicated math just to make simple displacements work. :(

    That would be a pain with either Poser or DS. In DS, the simplest option (if you don't, from what you say, want any negative displacement at all) would be to use your image editor to make 113 and darker black, leaving white as is and not adjusting the gamma. It's probably a good idea to convert to 16 bit depth, if you can, so that you don't lose any data.

  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited August 2013

    cwichura said:
    The displacement map simply represents the continuum between the min displacement value and max displacement value. It helps if you think of it as a range of floating point values from 0 to 1, rather than grayscale values of 0 to 255. E.g., 128 is .5, and 255 is 1.0. 0 is, of course, 0. Now the displacement of a given pixel is defined as:

    float(uv) * displacement map strength * ((max-min) + min)

    You can't just say '128' is no displacement. That's only true when min and max are equal opposites, as already stated. There is nothing 'wrong' with using 0 for min and treating the map like a 'poser map'. Studio just gives you an easier way to do inverse displacement than Poser does 'out of the box' is all.

    Does Studio support .exr files yet? If so, with EXRs for displacement and/or bump maps, you are supplying floats directly and don't have to worry about the integer->float resolution of 8 or 16bit integer input files. LuxRender lets you use .exr's, but truth be told, the imprecision of the integer->float conversion is usually not an issue in my experience.

    It's not really "easier" if you have a map that has a base color of, say, 113, and you're trying to figure out what the heck the negative displacement should be to keep that base surface from elevating! if its not neutral gray, and the positive displacement is 1, you can't just put a -1 for the negative displacement, because the gray isn't neutral. You'll still have a floating base! that's why its so darn complicated and painful to work with. It's not "easy" at all. Not when it has complicated math just to make simple displacements work. :(

    Didn't try but an easy way to workaround without doing complicated math could be eventually to use LIE and adding a grey map painted with (15,15,15) and using additive blending?

    {Edit] just another thought. you could also use a grey map painted with value (113,113,113) in LIE but this time with substractive blending and use your new map with min =0 and max = whatever you want

    Post edited by Takeo.Kensei on
Sign In or Register to comment.