public void SetShadingRate(TargetArea targetArea, ShadingRate rate) { if (foveatedRenderingInited) { var clampedRate = rate.Clamp(ShadingRate.CULL, ShadingRate.X1_PER_4X4_PIXELS); switch (targetArea) { case TargetArea.INNER: innerShadingRate = clampedRate; break; case TargetArea.MIDDLE: middleShadingRate = clampedRate; break; case TargetArea.PERIPHERAL: peripheralShadingRate = clampedRate; break; } ViveFoveatedRenderingAPI.SetShadingRate(targetArea, clampedRate); GL.IssuePluginEvent(ViveFoveatedRenderingAPI.GetRenderEventFunc(), (int)EventID.UPDATE_GAZE); } }
static extern public void SetShadingRate(TargetArea targetArea, ShadingRate rate);
private static extern void SetShadingRate(ShadingRate inner, ShadingRate middle, ShadingRate outer);