Merge pull request #10638 from samcake/hobbes

Adjust the preview to avoid seeing the masked pixels in HMD mode
This commit is contained in:
Brad Hefta-Gaub 2017-06-09 15:38:33 -07:00 committed by GitHub
commit 6006fa0fe1

View file

@ -221,6 +221,12 @@ void HmdDisplayPlugin::internalPresent() {
float shiftLeftBy = getLeftCenterPixel() - (sourceSize.x / 2);
float newWidth = sourceSize.x - shiftLeftBy;
// Experimentally adjusted the region presented in preview to avoid seeing the masked pixels and recenter the center...
static float SCALE_WIDTH = 0.9f;
static float SCALE_OFFSET = 2.0f;
newWidth *= SCALE_WIDTH;
shiftLeftBy *= SCALE_OFFSET;
const unsigned int RATIO_Y = 9;
const unsigned int RATIO_X = 16;
glm::uvec2 originalClippedSize { newWidth, newWidth * RATIO_Y / RATIO_X };