Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Hair material Thickness Texture on spline segments

    Cinema 4D SDK
    r20 r19 c++
    3
    6
    888
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rsodreR
      rsodre
      last edited by

      Hello,

      I have created a SplineObject with multiple segments scattered over a polygon, which I render using a Hair Material.
      Now I want to use the material's Thickness Texture property to control the segments thickness, just like it's used in the native Hair object, using the uvw coordinates from the polygon.
      But I don't understand how do I translate the polygon UVW coordinates to the spline's segments, in a way that the material will understand.
      Is this even possible, or it's something that just the Hair object is capable of doing?

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @rsodre
        last edited by

        @rsodre said in Hair material Thickness Texture on spline segments:

        I have created a SplineObject with multiple segments scattered over a polygon, which I render using a Hair Material.
        Now I want to use the material's Thickness Texture property to control the segments thickness, just like it's used in the native Hair object, using the uvw coordinates from the polygon.

        Hm, I do not really understand what you are trying to do.

        But I don't understand how do I translate the polygon UVW coordinates to the spline's segments, in a way that the material will understand.

        But that sounds to me, like you are asking how to transform between (affine) UVW and (euclidean) world space?

        Cheers
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          Hello,

          It could be nice if you could share a screenshot of what you want to create. Just to be sure.

          For what we understood, the Hair object is doing this internally and so the hair material.
          For us, it's impossible.

          the way we understand it, an example :
          you create a gradient in the thickness of the hair texture,
          set that gradient in world coordinate
          spline on -x have a smaller thickness than spline on +x

          You want to do that but with uvw coordinates ?

          Cheers,
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

          rsodreR 1 Reply Last reply Reply Quote 0
          • rsodreR
            rsodre @Manuel
            last edited by

            @m_magalhaes Ok, this is created with native C4D Hair. The shader applied to the plane was copied to the Hair Material's Thickness Texture, so we have thicker strands over white, thinner over black.

            Screen Shot 2019-08-30 at 11.01.40.png

            I created a single spline with multiple segments, using the same material to render. But the Tickness Texture has no effect. In fact, looks like it is applied over the segments length. I should have to somehow transfer the UV coordinates of the plane to the segments in a way that the Thickness Texture will understand. Is that possible?

            Screen Shot 2019-08-30 at 11.04.46.png

            1 Reply Last reply Reply Quote 0
            • ManuelM
              Manuel
              last edited by

              That's what we understood, I'm afraid it's not possible, it's something done inside the hair object and not available for 3rd Party.

              Cheers,
              Manuel

              MAXON SDK Specialist

              MAXON Registered Developer

              rsodreR 1 Reply Last reply Reply Quote 0
              • rsodreR
                rsodre @Manuel
                last edited by

                @m_magalhaes Based on the hair_shader.cpp example, I implemented a workaround with a custom shader on the Texture attribute, using calc_sample to sample per segment. Works fine!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post