Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    How to apply PostEffect to Viewport in realtime?

    Cinema 4D SDK
    2
    3
    436
    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.
    • M
      maxiokid
      last edited by

      Hi community!

      I'm upgrading a plug-in to apply a post effect in realtime to the viewport. The plug-in was working until R23, and now doesn't work realtime in the viewport (no code change).

      I'm using the vpinvertimage example as base.

      So far my only finding is without this line the post effect won't be rendered in realtime.

      https://github.com/PluginCafe/cinema4d_cpp_sdk_extended/blob/e23f0f94b45bca4cf14ea4aff2f9fdc07aa8c00e/plugins/cinema4dsdk/source/videopost/vpinvertimage.cpp#L91

      However I can't make sense of it since the viewportId "invert" doesn't appear anywhere else in the code, and I couldn't find any other differences between this effect and the other examples that doesn't get rendered realtime.

      Any ideas?

      Thank you for your help

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @maxiokid
        last edited by ferdinand

        Hello @maxiokid,

        Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!

        Getting Started

        Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:

        • Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
        • Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
        • Forum Structure and Features: Lines out how the forum works.
        • Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.

        About your First Question

        ⚠ The major problem with your first question is that it is missing essential information. Please have a look at Structure of a Question and Forum Structure and Features.

        You should:

        • Share your code
        • Tag your posting with programming language, OS version, and c4d version
        • Clarify what constitutes as "doesn't work" for you here
        • Line out what is a "real time PostEffect" for you, because there are two ways to achieve what could be considered "real time".

        I can only speculate here due to the lack of code and additional information, but I would suspect your problems being tied to the fact that the viewport drawing API did change internally since R23. There can also other things come into play such as colliding IDs, but I cannot spend here pages on what you might be doing. Please provide sufficient information to answer your question.


        ViewportRenderIDMessageData::viewportId is used to register your viewport effect, you must pass here a char sequence which uniquely identifies your plugin.

        Our example you quoted is not written too well in that regard, because "invert" is a poor ID choice, it should be at least "ID_INVERTVIDEOPOST", the symbol for the plugin ID. That is what we did internally in the past, here the material type Mmaterial is for example registering its effect:

        cd561f3f-c5eb-4c28-abec-b94a990e6582-image.png

        The quoted example is also missing the GL implementation of the effect in the first place.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • M
          maxiokid
          last edited by

          Thank you for the reply. I'll create a new topic

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