Gamma correction for OpenVR;

This commit is contained in:
bjorn 2017-11-23 23:40:20 -08:00
parent 76f690e813
commit f34d3536cf
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,7 @@ Texture* lovrTextureCreate(TextureType type, TextureData* slices[6], int sliceCo
}
Texture* lovrTextureCreateWithFramebuffer(TextureData* textureData, TextureProjection projection, int msaa) {
Texture* texture = lovrTextureCreate(TEXTURE_2D, &textureData, 1, true);
Texture* texture = lovrTextureCreate(TEXTURE_2D, &textureData, 1, false);
if (!texture) return NULL;
int width = texture->width;

View File

@ -786,7 +786,8 @@ static void openvrRenderTo(headsetRenderCallback callback, void* userdata) {
// Submit
uintptr_t texture = (uintptr_t) state.texture->id;
ETextureType textureType = ETextureType_TextureType_OpenGL;
Texture_t eyeTexture = { (void*) texture, textureType, EColorSpace_ColorSpace_Gamma };
EColorSpace colorSpace = lovrGraphicsIsGammaCorrect() ? EColorSpace_ColorSpace_Linear : EColorSpace_ColorSpace_Gamma;
Texture_t eyeTexture = { (void*) texture, textureType, colorSpace };
EVRSubmitFlags flags = EVRSubmitFlags_Submit_Default;
state.compositor->Submit(vrEye, &eyeTexture, NULL, flags);
@ -819,6 +820,7 @@ static void openvrRenderTo(headsetRenderCallback callback, void* userdata) {
}
static void openvrUpdate(float dt) {
//
}
HeadsetInterface lovrHeadsetOpenVRDriver = {