mirror of
https://github.com/overte-org/overte.git
synced 2025-04-06 00:33:13 +02:00
Fix gamma correction on Quest
This commit is contained in:
parent
19f856b760
commit
fd65f51140
3 changed files with 9 additions and 4 deletions
|
@ -30,8 +30,10 @@ vec4 color_LinearTosRGBA(vec4 lrgba) {
|
||||||
return vec4(color_LinearTosRGB(lrgba.xyz), lrgba.w);
|
return vec4(color_LinearTosRGB(lrgba.xyz), lrgba.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME switch to texelfetch for getting from the source texture
|
// FIXME switch to texelfetch for getting from the source texture?
|
||||||
void main() {
|
void main() {
|
||||||
FragColorL = color_LinearTosRGBA(texture(sampler, vTexCoordLR.xy));
|
//FragColorL = color_LinearTosRGBA(texture(sampler, vTexCoordLR.xy));
|
||||||
FragColorR = color_LinearTosRGBA(texture(sampler, vTexCoordLR.zw));
|
//FragColorR = color_LinearTosRGBA(texture(sampler, vTexCoordLR.zw));
|
||||||
|
FragColorL = texture(sampler, vTexCoordLR.xy);
|
||||||
|
FragColorR = texture(sampler, vTexCoordLR.zw);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,9 @@ void Framebuffer::drawBuffers(ovrEye eye) const {
|
||||||
void Framebuffer::SwapChainInfo::create(const glm::uvec2 &size) {
|
void Framebuffer::SwapChainInfo::create(const glm::uvec2 &size) {
|
||||||
index = 0;
|
index = 0;
|
||||||
validTexture = false;
|
validTexture = false;
|
||||||
swapChain = vrapi_CreateTextureSwapChain3(VRAPI_TEXTURE_TYPE_2D, GL_RGBA8, size.x, size.y, 1, 3);
|
// GL_SRGB8_ALPHA8 and GL_RGBA8 appear to behave the same here. The only thing that changes the
|
||||||
|
// output gamma behavior is VRAPI_MODE_FLAG_FRONT_BUFFER_SRGB passed to vrapi_EnterVrMode
|
||||||
|
swapChain = vrapi_CreateTextureSwapChain3(VRAPI_TEXTURE_TYPE_2D, GL_SRGB8_ALPHA8, size.x, size.y, 1, 3);
|
||||||
length = vrapi_GetTextureSwapChainLength(swapChain);
|
length = vrapi_GetTextureSwapChainLength(swapChain);
|
||||||
if (!length) {
|
if (!length) {
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ_OVR", "Unable to count swap chain textures");
|
__android_log_write(ANDROID_LOG_WARN, "QQQ_OVR", "Unable to count swap chain textures");
|
||||||
|
|
|
@ -313,6 +313,7 @@ struct VrSurface : public TaskQueue {
|
||||||
ovrJava java{ vm, env, oculusActivity };
|
ovrJava java{ vm, env, oculusActivity };
|
||||||
ovrModeParms modeParms = vrapi_DefaultModeParms(&java);
|
ovrModeParms modeParms = vrapi_DefaultModeParms(&java);
|
||||||
modeParms.Flags |= VRAPI_MODE_FLAG_NATIVE_WINDOW;
|
modeParms.Flags |= VRAPI_MODE_FLAG_NATIVE_WINDOW;
|
||||||
|
modeParms.Flags |= VRAPI_MODE_FLAG_FRONT_BUFFER_SRGB;
|
||||||
if (noErrorContext) {
|
if (noErrorContext) {
|
||||||
modeParms.Flags |= VRAPI_MODE_FLAG_CREATE_CONTEXT_NO_ERROR;
|
modeParms.Flags |= VRAPI_MODE_FLAG_CREATE_CONTEXT_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue