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

    Is it possible to completely manipulate camera ray

    SDK Help
    0
    5
    533
    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 23/01/2016 at 04:51, xxxxxxxx wrote:

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

      ---------
      I'm looking at writing a plugin somewhat analogous to Lightwave's surface bake camera, which (as I understand it) lets you render out a scene to a texture using a specified mesh and UV map. I believe the way this works is that the raster space is basically mapped onto the 2D UV texture, and then the camera rays are fired downwards towards the mesh so that the rays are parallel to the polygon (or phong?) normal, hitting anything down along the way. This basically lets you bake out things like floating geometry or high poly models to low poly models by controlling the distance from the surface at which the camera rays are spawned. Modo seems to have a very similar feature that works quite well.

      I know C4D has the "bake texture" tag, but this feature hasn't been touched in years (decades?) and doesn't support baking out floating geometry or stacked materials applied via polygon selections or alpha masks. I need to be able to do these things, preferably inside C4D, which means I guess I'm gonna have to write my own plugin to do it.

      Anyways, what I'm wondering is where I should be starting with this... I know you can manipulate the camera rays in C4D as I'm pretty sure Per-Anders' Degamma plugin does this as a part of his VR rendering solution. What I don't know is what kind of plugin type is required to actually do this (and I can't find a demo of Degamma anywhere).

      Can anyone offer any kinds of pointers on where to begin with something like this? I will ultimately need to control where the camera rays originate from and their vector, presumably before anything is actually rendered. I think I can handle the rest, I just don't really know where to begin.

      Thanks,
      -CMPX

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

        On 23/01/2016 at 05:47, xxxxxxxx wrote:

        Hey, that's already on my todo list! Tongue

        On a side note, look at VideoPostData::CreateRay().

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

          On 23/01/2016 at 19:58, xxxxxxxx wrote:

          Thanks for the reply!

          That looks like it's what I'm looking for. I'm a little bit confused about the wording of "Video Post Data"... Can a VPD plugin actually run during the renderer itself? For some reason I always thought this class was used for applying effects to the finished render (hence the "post" bit), not manipulating camera rays and what not during the render (but that seems to be what VIDEOPOSTINFO_CUSTOMLENS is for)...

          -CMPX

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

            On 24/01/2016 at 04:22, xxxxxxxx wrote:

            Yes it can do post effects, but you can also do custom renderers and lens plugins with it. The name really is misleading. 😉

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

              On 25/01/2016 at 01:28, xxxxxxxx wrote:

              Hello,

              the "Execute" function and other functions of a VideoPostData plugin are called at various stages of the rendering process. The calling sequence of  "Execute" is described in the documentation.

              Best wishes,
              Sebastian

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