How to apply PostEffect to Viewport in realtime?
-
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.
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
-
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 typeMmaterial
is for example registering its effect:The quoted example is also missing the GL implementation of the effect in the first place.
Cheers,
Ferdinand -
Thank you for the reply. I'll create a new topic