Iray negative displacement for engraving effect

Hopefully somebody can help with a problem I'm having.  I'm trying to get the letters in the "More Than Words" wood cubes to look engraved.  I created a displacement map adopted from a grayscale map of the letters, by changing it into a two-tone black and white map in photoshop.  The map works fine with positive displacement, so far so good.  But when I apply a negative value to minimum displacement, that value has no effect; the black portions of the map remain at zero displacement and there's no indentation into the prop.

Is there some trick to getting negative displacement to show up in an Iray render?  I know the map works and that my SubD is sufficient because I can get the basic effect by increasing the maximum displacement above zero.  But that messes up alignment with other props, etc., because it's increasing the apparent dimensions of the prop.

It just seems like there must be something I'm missing to "unlock" negative displacement.

Comments

  • jestmartjestmart Posts: 4,449
    edited October 2017

    If the letters are white and the background black invert the image.  Also the block model must have enough mesh density for displacement to look good in Iray, there is a sub-d setting in the Iray Uber shadow to increase mesh density if the model itself doesn't have enough.

    Post edited by jestmart on
  • For engraving you'd want to invert the map, though you could try applying a negative value to Maximum Displacement (and 0 to Minimum).

  • thoreandanthoreandan Posts: 151
    edited October 2017

    The letters are already black in the displacement map I made, everything else is white.

    SubD is not the problem, I already set this to a sufficient value (8 worked well) to get the engraved effect by increasing maximum displacement and leaving minimum displacement at 0, but that changes the apparent size of the object because everything except the letters grows outwards (which is what I'm trying to avoid).

    I tried putting a negative value in Max Displacement, but this seems to use the absolute value of whatever you enter.  When I try -2.0, it ignores the negative and displaces the white portions outwards by 2.0.

    Post edited by thoreandan on
  • OK, so you are trying an indent in Minimum and zero in maximum? That certainly should work.

  • Just tested and it looks to me as if 0 maximum displacement is cancelling and minimum value. It works normally in 3Delight

  • OK, so you are trying an indent in Minimum and zero in maximum? That certainly should work.

    Yep, that's exactly what I'm trying.  But I've tried any combination I can think of, and in all cases it seems to ignore any minimum value that is below zero.

    Just tested and it looks to me as if 0 maximum displacement is cancelling and minimum value. It works normally in 3Delight

    Even if there is a non-zero value in maximum displacement, Iray still seems to ignore the minimum displacement value.  In other words, if I set Minimum to -1.0, or even -10.0, and Maximum to 0.1, the black areas of the displacement map still do not indent from their initial position, and the white areas move out by 0.1.  So I don't think it is the zero value in Maximum that is causing the problem.  Negative values in Minimum Displacement just don't seem to work.

  • OK, so you are trying an indent in Minimum and zero in maximum? That certainly should work.

    Yep, that's exactly what I'm trying.  But I've tried any combination I can think of, and in all cases it seems to ignore any minimum value that is below zero.

    Just tested and it looks to me as if 0 maximum displacement is cancelling and minimum value. It works normally in 3Delight

    Even if there is a non-zero value in maximum displacement, Iray still seems to ignore the minimum displacement value.  In other words, if I set Minimum to -1.0, or even -10.0, and Maximum to 0.1, the black areas of the displacement map still do not indent from their initial position, and the white areas move out by 0.1.  So I don't think it is the zero value in Maximum that is causing the problem.  Negative values in Minimum Displacement just don't seem to work.

    Yes, that's what I found with testing - I think (my sphere test did seem to show some indenting happening but that may have been illusion).

  • Oso3DOso3D Posts: 14,887

    I ended up using shader mixer to make this work how I wanted.

     

  • jestmartjestmart Posts: 4,449

    I just don't use displacement in Iray so I've never seen the problem.  The displacement is a value map with black = 0, white = 1 and the grays are the fractions in between.  The map is multiplied to the displacement value and the minimum and maximum values are offsets, at least that is how it works for 3Delight.  It seems like for Iray the minimum and maximum values may be also be multiplied through map so anything black on the map would have no displacement so inverting the map with a negative maximum value and a 0 minimum value might work.

  • jestmart said:

    I just don't use displacement in Iray so I've never seen the problem.  The displacement is a value map with black = 0, white = 1 and the grays are the fractions in between.  The map is multiplied to the displacement value and the minimum and maximum values are offsets, at least that is how it works for 3Delight.  It seems like for Iray the minimum and maximum values may be also be multiplied through map so anything black on the map would have no displacement so inverting the map with a negative maximum value and a 0 minimum value might work.

    Not in a quick test.

  • From further testing on various surfaces, it seems that the absolute value of negative displacement is limited by the absolute value of positive displacement. So if you set Minimum to -1.0 and Maximum to 0.5, in the render you will get an effective minimum displacement of -0.5 for black areas of the map and 0.5 for white.  That’s why setting Maximum to 0 effectively eliminated displacement completely.  This is annoying because it eliminates effective engraving of flat surfaces where the surface is aligned with other props, unless you plan out where the max displacement will move the flat surface and adjust the scene accordingly.

    However, I know there’s a new version out today and I don’t know if this has changed, I’ll have to try it out and see. 

  • From further testing on various surfaces, it seems that the absolute value of negative displacement is limited by the absolute value of positive displacement. So if you set Minimum to -1.0 and Maximum to 0.5, in the render you will get an effective minimum displacement of -0.5 for black areas of the map and 0.5 for white.  That’s why setting Maximum to 0 effectively eliminated displacement completely.  This is annoying because it eliminates effective engraving of flat surfaces where the surface is aligned with other props, unless you plan out where the max displacement will move the flat surface and adjust the scene accordingly.

    However, I know there’s a new version out today and I don’t know if this has changed, I’ll have to try it out and see. 

    That sounds plausible - I had noticed that there did seem to be some kind of limiting on negative displacement but hadn't worked out what it was.

  • Version 4.10 still has the same limitation, you can only get as much negative displacement in the minimum as you allow for positive displacement in the maximum.

    However, all along I've been missing the obvious solution: adjust the displacement map so that the "white" portions are 50% gray instead.  Now the flat surface doesn't move, and I can get the engraved effect by setting the maximum displacement to match the minimum (without the negative).

  • Oso3DOso3D Posts: 14,887

    If it matters I'm working on a shader that fixes this. :)

Sign In or Register to comment.