Skip to main content
Up and Coming
August 4, 2014

SDK 0.4.0 struct ovrDistortionVertex

The 'ovrDistortionVertex' struct in the SDK 0.4.0 does not match the documentation, and I have no clue what to do with this.

Either that, or I'm drunk.

This is the struct as in the SDK...
/// Describes a vertex used by the distortion mesh. This is intended to be converted into
/// the engine-specific format. Some fields may be unused based on the ovrDistortionCaps
/// flags selected. TexG and TexB, for example, are not used if chromatic correction is
/// not requested.
typedef struct ovrDistortionVertex_
{
ovrVector2f ScreenPosNDC; // [-1,+1],[-1,+1] over the entire framebuffer.
float TimeWarpFactor; // Lerp factor between time-warp matrices. Can be encoded in Pos.z.
float VignetteFactor; // Vignette fade factor. Can be encoded in Pos.w.
ovrVector2f TanEyeAnglesR;
ovrVector2f TanEyeAnglesG;
ovrVector2f TanEyeAnglesB;
} ovrDistortionVertex;


This is the example code...
DistortionVertex * v = pVBVerts;
ovrDistortionVertex * ov = meshData.pVertexData;
for ( unsigned vertNum = 0; vertNum < meshData.VertexCount; vertNum++ )
v->Pos.x = ov->Pos.x;
v->Pos.y = ov->Pos.y;
v->TexR = (*(Vector2f*)&ov->TexR);
v->TexG = (*(Vector2f*)&ov->TexG);
v->TexB = (*(Vector2f*)&ov->TexB);
v->Col.R = v->Col.G = v->Col.B = (OVR::UByte)( ov->VignetteFactor * 255.99f );
v->Col.A = (OVR::UByte)( ov->TimeWarpFactor * 255.99f );
v++;


Or did they just rename all the parameters?

    2 replies

    Up and Coming
    August 4, 2014
    They've just changed the names to be a bit more descriptive. If you use ScreenPosNDC instead of Pos and TanEyeAnglesR etc instead of TexR it seems to work as before.
    kaetemiAuthor
    Up and Coming
    August 4, 2014
    "rsjtaylor" wrote:
    They've just changed the names to be a bit more descriptive.
    Haha, okay.
    Kaetemi | Ryzom Core MMORPG Engine