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

    CreateExtendedRay() never called [SOLVED]

    SDK Help
    0
    6
    500
    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 04/03/2015 at 10:42, xxxxxxxx wrote:

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

      ---------
      Hi!

      I'm trying to create a custom lens video post, but I hit some problems.

      I can't get VideoPostData::CreateExtendedRay() to be called.
      I return VIDEOPOSTINFO_CUSTOMLENS_EXTENDED from VideoPostData::GetRenderInfo(), but that
      doesn't seem to be all of what's necessary. I also tried adding VIDEOPOSTINFO_CUSTOMLENS in addition.

      skyphyr seems to have had the same problem in this thread.

      So what I was trying to do to work around this, is to use VideoPostData::CreateRay() instead and
      compute the lens X and Y values using the renders resolution. But I get resolution values that do not
      appear to make sense to me.

      RENDERRESULT CamVideoPost::Execute(BaseVideoPost* vp, VideoPostStruct* vps) {
        /* Read the render resolution so we can use it in CreateRay(). */
        if (vps->vp == VIDEOPOSTCALL_RENDER && vps->open) {
          BaseContainer bc = vps->render->GetRenderData();
          m_width = bc.GetReal(RDATA_XRES);
          m_height = bc.GetReal(RDATA_YRES);
          m_valid = (m_width > 0.001 && m_height > 0.001);
          GePrint("Width: " + RealToString(m_width) + ", Height: " + RealToString(m_height));
        }
        return RENDERRESULT_OK;
      }
      

      This gives me "Width: 1183, Height: 764" on a scene with resolution 200x100 ??

      Any hints are highly appreciated.

      Best,
      Niklas

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

        On 05/03/2015 at 03:04, xxxxxxxx wrote:

        Update : For #2, I seem to have messed up the output of the editor render with the output of the
        Picture Viewer render. The values seem to be ok! Still, it would be nice to use CreateExtendedRay(). 🙂

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

          On 09/03/2015 at 07:41, xxxxxxxx wrote:

          Is it also possible to change the lens of the Viewport, not only of the
          final rendering?

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

            On 10/03/2015 at 06:18, xxxxxxxx wrote:

            Hello,

            CreateExtendedRay() only works with the Physical renderer. You have to set VIDEOPOSTINFO_CUSTOMLENS to get CreateRay() called and you have to set also VIDEOPOSTINFO_CUSTOMLENS_EXTENDED to have CreateExtendedRay() called.

            Best wishes,
            Sebastian

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

              On 10/03/2015 at 08:03, xxxxxxxx wrote:

              That explains it, thanks. Do you also know if it is somehow possible to preview the lens in the Viewport?

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

                On 11/03/2015 at 02:40, xxxxxxxx wrote:

                Hello,

                the only way to do something similar in the viewport I can think of is using the GlDraw() method to create an equivalent GLSL fragment shader. Please notice that this functionality is not documented.

                Best wishes,
                Sebastian

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