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

    Manipulating textures before interpolation?

    SDK Help
    0
    6
    531
    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 07/06/2015 at 23:51, xxxxxxxx wrote:

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

      ---------
      Greetings to all!

      Is there any way to manipulate textures *before* interpolation within C4D? I'm trying to load up some PNG files, but I need to do some math on the raw pixel values before C4D can use them. I've thought about writing a bitmap loader plugin, but there doesn't seem to be any way to attach user-configurable options to that.

      Then I thought about writing my own bitmap channel shader, but that would mean that I'd have to re-implement all the interpolation types (nearest, mip, sat, circle, square, alias1, alias2, alias3, etc) myself. At the moment, I've written an external utility to process the actual image files but I'd much rather have that functionality inside C4D.

      What's the best way to go about this?

      -CMPX

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

        On 08/06/2015 at 04:02, xxxxxxxx wrote:

        I think it should be a ShaderData plugin, there is an example that Sebastian has published a while ago, 
        http://bach-sebastian.de/download/materialData_example.zip

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

          On 09/06/2015 at 08:47, xxxxxxxx wrote:

          Hello,

          the Xbitmap shader loads, samples and interpolates the given bitmap internally, there is no way to change that.

          You can of course write you own ShaderData based shader that samples a sub-shader and works with the given output like the Colorizer shader. An example is the BitmapDistortion shader in the SDK. What exactly are you trying to achieve?

          The linked example is not an example on ShaderData but on MaterialData.

          best wishes,
          Sebastian

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

            On 09/06/2015 at 09:02, xxxxxxxx wrote:

            ops, sorry for this.

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

              On 19/06/2015 at 09:13, xxxxxxxx wrote:

              Hello CMPX,

              was your question answered?

              Best wishes,
              Sebastian

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

                On 20/06/2015 at 16:41, xxxxxxxx wrote:

                Yeah, it's answered, though I didn't find a solution.

                Unfortunately I needed to be able to process the image data before interpolation, and as you stated that doesn't seem to be possible short of writing my own image loader that does interpolation manually. I landed up just sticking with my external utility to process the texture files outside of C4D.

                -CMPX

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