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

    GI in volume shader.

    SDK Help
    0
    6
    772
    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 05/02/2003 at 15:59, xxxxxxxx wrote:

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

      ---------
      Hi.
      I asked about this a little while ago.  Basically I want my volume shader to handle Global Illumination correctly.  I was given the following set of keys to be used with the Base Container:
      MAT_GI_RECEIVE
      MAT_GI_GENERATE
      MAT_GI_RECEIVESTRENGTH
      MAT_CS_RECEIVE
      MAT_CS_GENERATE
      MAT_CS_SAMPLERADIUS
      MAT_CS_ACCURACY
      MAT_GI_GENERATESTRENGTH
      MAT_CS_GENERATESTRENGTH
      MAT_CS_RECEIVESTRENGTH
      So my question is when and what type.  Is this set in the Message function on MSG_GETDATA?  If not, when and where.  Also, what are the types and ranges (Bool, Real, Long, 0-1)?

      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 15/02/2003 at 13:29, xxxxxxxx wrote:

        The min/max values and datatypes can be read from this R8 description(e.g. MAT_RECEIVE_STRENGTH is 0% min, 10000% max and datatype REAL) :
        > GROUP ID_SIMPLEMATERIALGROUP_ILLUMINATION
        >
        > {
        >
        > COLUMNS 2;
        >
        > BOOL SIMPLEMATERIAL_GLOBALILLUM_GENERATE {}
        >
        > REAL SIMPLEMATERIAL_GLOBALILLUM_GENERATE_STRENGTH { UNIT PERCENT; MIN 0.0; MAX 10000.0; }
        >
        >  
        >
        > BOOL SIMPLEMATERIAL_GLOBALILLUM_RECEIVE {}
        >
        > REAL SIMPLEMATERIAL_GLOBALILLUM_RECEIVE_STRENGTH { UNIT PERCENT; MIN 0.0; MAX 10000.0; }
        >
        >  
        >
        > SEPARATOR { }
        >
        > REAL SIMPLEMATERIAL_GLOBALILLUM_SATURATION { UNIT PERCENT; MIN 0.0; MAX 1000.0; }
        >
        >  
        >
        > SEPARATOR { }
        >
        > SEPARATOR { }
        >
        >  
        >
        > BOOL SIMPLEMATERIAL_CAUSTIcs_GENERATE {}
        >
        > REAL SIMPLEMATERIAL_CAUSTIcs_GENERATE_STRENGTH { UNIT PERCENT; MIN 0.0; MAX 10000.0; }
        >
        >  
        >
        > BOOL SIMPLEMATERIAL_CAUSTIcs_RECEIVE {}
        >
        > REAL SIMPLEMATERIAL_CAUSTIcs_RECEIVE_STRENGTH { UNIT PERCENT; MIN 0.0; MAX 10000.0; }
        >
        >  
        >
        > SEPARATOR { }
        >
        > REAL SIMPLEMATERIAL_CAUSTIcs_SAMPLERADIUS { UNIT METER; MIN 0.0; }
        >
        > SEPARATOR { }
        >
        > LONG SIMPLEMATERIAL_CAUSTIcs_SAMPLES { MIN 1; MAX 10000; }
        >
        > }
        In R7 you need to implement the GUI display and evaluation of those values (best: own Illumination tab like in the C4D material).
        Initialization of defaults, GetData() and SetData() should be working automatically, so basically it's only a matter of programming the GUI!

        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 17/02/2003 at 17:13, xxxxxxxx wrote:

          >
          > Thanks for the help.  I was able to get SetData() to work and I am now going to create an illumination tab as you suggest.
          >
          > I still have a question about how GI interacts with the shader.  I have implemented our own shading code in CalcSurface.  How do I receive/get GI lighting?  My surface is able to generate GI lighting but not receive.
          >
          > Thanks.
          >
          >  
          >
          > Quote: Originally posted by Mikael Sterner on 15  February 2003
          >
          > * * *
          >
          > The min/max values and datatypes can be read from this R8 description(e.g. MAT_RECEIVE_STRENGTH is 0% min, 10000% max and datatype REAL) :
          >
          > In R7 you need to implement the GUI display and evaluation of those values (best: own Illumination tab like in the C4D material).
          >
          > Initialization of defaults, GetData() and SetData() should be working automatically, so basically it's only a matter of programming the GUI!
          >
          > * * *

          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 23/02/2003 at 02:51, xxxxxxxx wrote:

            Generally, the GI lighting works automatically (e.g. take a look at the SimpleMaterial example). C4D reads the container values and takes care of all operations.
            When having a custom illumination model (like in SimpleIllumModel) the 'radiosity' and 'caustics' components are already filled and as long as they are not altered by the illumination model they will be added to the diffuse component afterwards.
            A custom illumination model is not needed for GI though.
            Do you use Illuminance2()? Illuminance2 and 3 do not evaluate GI / Caustics as they specify an arbitrary point in space (not necessarily a point on a surface).

            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 26/02/2003 at 16:43, xxxxxxxx wrote:

              Quote: Originally posted by Mikael Sterner on 23  February 2003
              >
              > * * *
              >
              > Do you use Illuminance2()? Illuminance2 and 3 do not evaluate GI / Caustics as they specify an arbitrary point in space (not necessarily a point on a surface).
              >
              > * * *
              Actually, I didn't use an Illuminance function at all.  I cycled through the lights on my own.  I used:
              sd->GetLightCount
              for( light count )
              {
                   sd->Illuminate (light.....)
                   shade....diffuse, specular, anisotropic, clear coat....
              }
              Can I get this information without going through Illuminance?  Exactly what happens when?  When is the GI information tacked onto the diffuse in Illuminance?  I am hoping I don't have to re-write my shading code around this function.
              Thanks.

              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 27/02/2003 at 12:33, xxxxxxxx wrote:

                No, the call to Illuminance() is essential as new GI rays are calculated within this routine. Using Illuminance() should be not much work though:

                    
                    
                    vd->Illuminance(&diff,&spec,SimpleIllumModel,this);
                

                SimpleIllumModel shows how to retrieve the diffuse and specular components per light, similar to calling vd->Illuminate(). Every light is accessible, so this should be pretty straightforward to use.

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