On 12/01/2016 at 03:20, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14+
Platform:
Language(s) : C++ ;
---------
Hey there,
so a very basic example from VideoPostData::Execute() :
// Render the color and object buffer data.
if (vps->vd && vps->render && vps->vp == VIDEOPOSTCALL_RENDER
&& !vps->open && colorBuffer_ != 0) {
VPBuffer* colorBuf = vps->render->GetBuffer(VPBUFFER_POSTEFFECT, colorBuffer_);
LONG const xres = colorBuf->GetInfo(VPGETINFO_XRESOLUTION);
LONG const yres = colorBuf->GetInfo(VPGETINFO_YRESOLUTION);
LONG const cpp = colorBuf->GetInfo(VPGETINFO_CPP);
Bool hit;
Ray ray;
SurfaceIntersection si;
for (LONG y = 0; y < yres; ++y) {
for (LONG x = 0; x < xres; ++x) {
// Find the first polygon that hits the ray for the current pixel.
vps->vd->GetRay(x, y, &ray);
hit = vps->vd->TraceGeometry(&ray, MAXREALr, vps->vd->lhit, &si);
if (!hit || !si.op || !si.op->link) {
continue;
}
SReal pixel[3] = {1.0, 1.0, 1.0};
colorBuf->SetLine(x, y, 1, &pixel, 32, false);
}
}
}
This works perfectly fine. Example for a simple cube:
My problem is that I have no idea how to apply anti aliasing to the buffer. Ideally it should be the
same anti aliasing that is defined in the render settings. Are there any examples that I might have
missed in my searches? Or does anyone have an idea how to do it?
Thanks in advance,
Niklas