Announcement

Collapse
No announcement yet.

MASH and scaling instances with displacement shader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MASH and scaling instances with displacement shader

    Hello,

    There might not be a solution for this, but I'll give it a shot.
    Say that I have an object in Maya that depends on the use of displacement maps at render time. Now I'd like to use MASH to make a lot of instances of this object (or just make a lot of instances without Mash). This works fine until you start to play around with scaling, since the Displacement Amount doesn't care about scaling and doesn't scale along with the objects. I made a simple expression that multiplies the Displacement Amount by the scaling value of the object. This works fine on the original object, but doesn't carry over to the instances. Is there a way to make this work. Otherwise it would be nice if you could add a feature that automatically scales the Displacement Amount (and shift) along with each instance. I often make pretty complex materials that depend on displacement mapping and our customers more and more request MASH solutions.

    I though of a possible solution; to bake the displacement and make a proxy object. Is there away to export the displaced object that VRay generates at render time?

    Thank you!

  • #2
    I wouldn't know how to do that scaling with mash tbh, but solution of baking down the displacement can be done. You'd have to displace the geometry in maya using texture deformer, then decimate it and export a decimated version.
    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

    Comment


    • #3
      Hi,

      Thanks for your reply. I'm a little scared to try and let Maya work on that amount of polygons. It's very dense geometry.

      However, I think I've solved it in MASH. I used a Python node to control the color a Color node based on the scale of each duplicate.
      Pretty much:
      100% Scale (original size) = white
      0% Scale = black

      The color node doesn't seem to suppert colors brighter than 1, 1, 1 (white), but I need larger value to make this work with objects larger than 100% size so I multiplied the colors by 0.01 in the Python script and then by 100 in Hypershade with a math node, since Hypershade supports values >1.

      I then use this color to control the intensity of the displacement map in Hypershade with some nodes.

      So if I scale the duplicates with a random node or a offset node the displacement intensity follows accordingly.



      Comment


      • #4
        Here's a sample file with the setup.
        Attached Files
        Last edited by Uniel; 02-05-2020, 10:59 AM.

        Comment

        Working...
        X