mirror of https://github.com/bjornbytes/lovr.git
Gamma correction for OpenVR;
This commit is contained in:
parent
76f690e813
commit
f34d3536cf
|
@ -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;
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue