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

    Shaders and multiple UVW tags?

    SDK Help
    0
    2
    178
    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.
    • H
      Helper
      last edited by

      On 16/06/2015 at 02:50, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R15 
      Platform:    Mac  ;  
      Language(s) :     C++  ;

      ---------
      Greetings to all.

      I'm in dire need of a shader that can select different UVW tags in order to allow for multiple UV sets within a single material. I'd like to write it myself, but I'm not entirely clear on where to start or if this is even possible within the C4D C++ SDK. I've found some mention to multiple UV sets in VolumeData::GetUVW(), but I don't know what this means or if it's what I'm looking for.

      I was wondering if anyone could offer any pointers on implementing a shader like this. What I'm basically looking to do is to have a shader that accepts a child shader, and has a slot for a UVW tag you can drop into it. That child shader then uses the UVW ordinates from the selected tag, rather then whichever tag might be the default based on the position of the material tag on the host object.

      PS: I'm not looking for anyone to write the shader for me- I'd just like to know: A) if it's possible, and B) where I might start in implementing such a beast.

      -CMPX

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 16/06/2015 at 07:03, xxxxxxxx wrote:

        Hello,

        A shader can handle subshaders (as seen in the Mograph Multi-Shader) and it should be possible to link to an UVW Tag. But the problem might be to determine the "new" UV coordinates for the currently rendered fragment. You would have to look at VolumeData and RayHitID. You might use GetPolygon() to get the polygon and use that information with the position of the current intersection point to calculate the new UVW coordinates.

        Best wishes,
        Sebastian

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