On 09/05/2015 at 00:07, xxxxxxxx wrote:
Hey Guys, thanks for chiming in!
Originally posted by xxxxxxxx
Did you try to set pp and vv equal to p and v resp.? Do you still get such distortions then?
Do you have ior set as well or is it 1.0 by default?
I think you are right, an sdk example would be quite useful.
No I only tried just not setting pp and vv at all. I'm going to try that, thanks!
Currently, my code looks like this:
/// ---------------------------------------------------------------------------
/// ---------------------------------------------------------------------------
void LensVideoPost::CreateRay(Ray* ray, Float x, Float y)
{
if (!this->rdata || !this->lens) return;
**ray- >ior = 1.0;**
Float lx, ly;
this->rdata->CalcLens(x, y, lx, ly);
this->lens->CreateRay(*this->rdata, lx, ly, ray->p, ray->v);
#ifdef LENSVIDEOPOST_MULTIRAY
this->rdata->CalcLens(x + 1, y, lx, ly);
this->lens->CreateRay(*this->rdata, lx, ly, ray->pp[0], ray->vv[0]);
this->rdata->CalcLens(x, y + 1, lx, ly);
this->lens->CreateRay(*this->rdata, lx, ly, ray->pp[1], ray->vv[1]);
this->rdata->CalcLens(x + 1, y + 1, lx, ly);
this->lens->CreateRay(*this->rdata, lx, ly, ray->pp[2], ray->vv[2]);
** #else**
** for (Int32 i = 0; i < 3; ++i) {**
** ray->pp[i] = ray->p;**
** ray->vv[i] = ray->v;**
** }**
#endif
}
Edit: Added the (bold) #else part and setting ior to 1.0. Unfortunately it didn't change the results 
Of course tested with LENSVIDEOPOST_MULTIRAY not defined.
The documentation says
The square is one screen pixel wide in X and Y direction.
This is why I offset x and y by 1 for pp[0], 1 and 2 respectively.