Announcement

Collapse
No announcement yet.

Procedurally map gradient based on height of object

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

  • Procedurally map gradient based on height of object

    I need to figure out a procedural way of mapping a gradient down the height of any object, so it starts at the top and ends at the bottom of the object.
    This needs to be regardless of the objects position in world space - so distancetex wont work for this for example.
    Is there some way to do this without manually adding UVW mapping to each object?

    Thanks

  • #2
    Gradient map set to object Z ? (actually it is YZ as shown in the screenshot below (below tiling)).
    • Planar from Object XYZ Uses planar mapping based on the object's local coordinates (disregarding the pivot point location). For rendering purposes, planar mapping doesn't project through to the back of the object unless you turn on Show Map On Back.
    Click image for larger version  Name:	image_69837.png Views:	4 Size:	25.7 KB ID:	1138104
    Note the Tiling is set to 0.99 to prevent it from wrapping around slightly and making a tiny white edge on the black end and a tiny black edge on the white end. (Try it without doing this and you will see. I normally prevent this on bitmaps by setting them to mirror, but mirroring did not want to work properly with 0.5 U and V offsets and tiling, which normally make mirror back to the normal scaling and positioning of Tile mode. )

    Click image for larger version  Name:	image_69838.png Views:	3 Size:	298.6 KB ID:	1138105

    The same material is on all those objects of different sizes.
    Last edited by Joelaff; 27-01-2022, 07:12 PM.

    Comment


    • #3
      Thankyou man - so simple !
      I have some problems with some of the objects in that they are not mapping properly in this way - does the pivot or xform etc have influence on this?

      Comment


      • #4
        I don’t think the pivot does, but I know there were a few gotchas, but I just can’t recall what they were. I seem to recall occasionally having to add a UVWMap and do it that way.

        Maybe ResetXForm helped. I can’t recall, sorry.

        Comment


        • #5
          All good, got it working exactly the way I needed - thankyou

          Comment


          • #6
            What was the trick to fixing the ones you had issues with?

            Comment

            Working...
            X