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
    • Recent
    • Tags
    • Users
    • Login

    Transparency in Volume Shader

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 259 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 14/12/2008 at 08:52, xxxxxxxx wrote:

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

      ---------
      In the end of my function
      void fogShader::CalcVolumetric(PluginMaterial *mat,VolumeData *vd)
      I have added the following two lines just to experiment with color and transparency.

      vd->col=1.0;
      vd->trans=1.0;

      My understanding is, that the volume should be fully transparent, but I get a white screen. Foley suggests for transparency
      I_k=(1-kt_1)*I_1+kt_2*I_2

      But that's obviously not what is used in C4d. However if you try just the values in c4d itself, it works like the formula, but not in the C function.

      Thanks for any comments.

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

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

        On 14/12/2008 at 23:49, xxxxxxxx wrote:

        Hi again,

        you must set vd->col = 0.0f; and vd->trans = 1.0f;

        You don´t have to calculate the transparency formula yourself. see it like c4d is calculating the formula itself and you only have to provide the fractional transparency information via your shader.

        Hope that helps

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

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

          On 15/12/2008 at 01:57, xxxxxxxx wrote:

          Thanks again, but I have the feeling the two values become a bit mixed up, if it is done in this way, i.e. vd->trans doesn't determine the transparency alone, it also depends on the color. What's the idea behind it?

          So what do I do, if I want to have a fog with color white and transparency e.g. 0.1? vd->col = 1.0f; and vd->trans = 0.1f is obviously the wrong answer, as this will give a white screen, and not something partly transparent.

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