Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Sample Shader

    SDK Help
    0
    5
    91
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 10/09/2011 at 12:40, xxxxxxxx wrote:

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

      ---------
      Hy there,

      in my TagData I Sample the color-channel Shader of a Material. I noticed, that I can just sample for example a Color Shader or a Bitmap Shader. If I try to sample a Layer Shader or a Gradient, the Sample method gives me an Access Violation Error.

      Did I forget something? Btw. I only initialize the ChannelDatas UV value 'p' when calling the Sample(..) method. Do I have to initialize more values on the ChannelData, if yes, which ones?

      Thank you,
      maxx

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 12/09/2011 at 05:14, xxxxxxxx wrote:

        You need to initialize every member variable of ChannelData because the constructor isn't initializing them on its own. You can pass NULL to ChannelData::vd but some shaders will not return anything useful because they need a valid initialized VolumeData.

        cheers,
        Matthias

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 12/09/2011 at 09:01, xxxxxxxx wrote:

          Ok, thanks for the information. How can I know if the Shader sampled correctly? Or is there a list of shaders that will need a VolumeData?

          I need to figure out which Shaders will work, otherwise there will be an exception at runtime...

          Thank you,
          maxx

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 12/09/2011 at 10:25, xxxxxxxx wrote:

            There is no list of shaders that need the VolumeData. Basically all shaders that do more than just UV based calculation need the VolumeData.

            There should be no exception at runtime if the shader is written well. Just the returned result will not make much sense.

            cheers,
            Matthias

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 12/09/2011 at 10:51, xxxxxxxx wrote:

              Ok, makes sense 😉

              Most likely the exception came from my (formerly) not fully initialized ChannelData.

              Thank you,
              maxx

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