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

    accessing bitmap shader

    Scheduled Pinned Locked Moved SDK Help
    1 Posts 0 Posters 119 Views
    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 Offline
      Helper
      last edited by

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

      On 04/02/2008 at 01:23, xxxxxxxx wrote:

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

      ---------
      Hi all,

      I'm trying to access the color value of a shader, while not in a rendering process. The Plugin should scale multiple objects, based on the gray value of a give shader - like the mograph shader-effektor does.

      I created a fake InitRenderStruct and ChannelData and all works fine with a normal shader like noise or gradient, but as soon as i load a bitmap it doesnt give proper values.

      > <code>
      > InitRenderStruct iStruct;
      > iStruct.doc = doc;
      > iStruct.docpath = &(doc->GetDocumentPath());
      > iStruct.errorlist = NULL;
      > iStruct.flags = 0;
      > iStruct.fps = doc->GetFps();
      > iStruct.matname = NULL;
      > iStruct.thread = thread;
      > iStruct.time = doc->GetTime();
      > iStruct.vd = NULL;
      > iStruct.version = GeGetVersionType();
      >
      > ChannelData cd;
      > cd.d = 0;
      > cd.off = 0;
      > cd.scale = 0;
      > cd.n = Vector(0,0,1);
      > cd.p = Vector(1,1,0);
      > cd.t = doc->GetTime().Get();
      > cd.texflag = 0;
      > cd.vd = NULL;
      >
      > shader->InitRender( &iStruct; );
      >
      > for (Real a=0; a<1; a += .1)
      >      for (Real b=0; b<1; b += .1)
      >      {
      >           cd.p = Vector( a, b, 0);
      >
      >           // this doesnt work for bitmaps ???
      >           Real testValue = shader->Sample(&cd;).x;
      >      }
      >
      > shader->FreeRender();
      > </code>

      Thanks in advance, Heinrich Löwe

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