mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-09 09:19:31 +02:00
THis should fix the mirror and the skybox issue
This commit is contained in:
parent
e005bb7b5a
commit
2aad26154e
4 changed files with 15 additions and 12 deletions
|
@ -1373,8 +1373,9 @@ void Application::paintGL() {
|
||||||
|
|
||||||
batch.setFramebuffer(finalFramebuffer);
|
batch.setFramebuffer(finalFramebuffer);
|
||||||
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f));
|
batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLOR0, glm::vec4(0.0f, 0.0f, 1.0f, 0.0f));
|
||||||
batch.blit(primaryFbo, srcRectLeft, finalFramebuffer, destRectLeft);
|
// BLit left to right and right to left in stereo
|
||||||
// batch.blit(primaryFbo, srcRectRight, finalFramebuffer, destRectRight);
|
batch.blit(primaryFbo, srcRectRight, finalFramebuffer, destRectLeft);
|
||||||
|
batch.blit(primaryFbo, srcRectLeft, finalFramebuffer, destRectRight);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
|
||||||
|
|
|
@ -1402,10 +1402,10 @@ void MyAvatar::updateOrientation(float deltaTime) {
|
||||||
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
glm::vec3 euler = glm::eulerAngles(localOrientation) * DEGREES_PER_RADIAN;
|
||||||
|
|
||||||
//Invert yaw and roll when in mirror mode
|
//Invert yaw and roll when in mirror mode
|
||||||
/* if (qApp->getCamera()->getMode() == CAMERA_MODE_MIRROR) {
|
if (qApp->getCamera()->getMode() == CAMERA_MODE_MIRROR) {
|
||||||
YAW(euler) *= -1.0f;
|
YAW(euler) *= -1.0f;
|
||||||
ROLL(euler) *= -1.0f;
|
ROLL(euler) *= -1.0f;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
head->setBaseYaw(YAW(euler));
|
head->setBaseYaw(YAW(euler));
|
||||||
|
|
|
@ -47,9 +47,6 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum,
|
||||||
Skybox::render(batch, viewFrustum, skybox);
|
Skybox::render(batch, viewFrustum, skybox);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpu::BufferPointer theBuffer;
|
|
||||||
static gpu::Stream::FormatPointer theFormat;
|
|
||||||
|
|
||||||
if (skybox._procedural && skybox._procedural->_enabled && skybox._procedural->ready()) {
|
if (skybox._procedural && skybox._procedural->_enabled && skybox._procedural->ready()) {
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
viewFrustum.evalProjectionMatrix(projMat);
|
viewFrustum.evalProjectionMatrix(projMat);
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
<@include gpu/Inputs.slh@>
|
|
||||||
|
|
||||||
<@include gpu/Transform.slh@>
|
<@include gpu/Transform.slh@>
|
||||||
|
|
||||||
<$declareStandardTransform()$>
|
<$declareStandardTransform()$>
|
||||||
|
@ -21,11 +18,19 @@
|
||||||
out vec3 _normal;
|
out vec3 _normal;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
|
const float depth = 0.0;
|
||||||
|
const vec4 UNIT_QUAD[4] = vec4[4](
|
||||||
|
vec4(-1.0, -1.0, depth, 1.0),
|
||||||
|
vec4(1.0, -1.0, depth, 1.0),
|
||||||
|
vec4(-1.0, 1.0, depth, 1.0),
|
||||||
|
vec4(1.0, 1.0, depth, 1.0)
|
||||||
|
);
|
||||||
|
vec4 inPosition = UNIT_QUAD[gl_VertexID];
|
||||||
|
|
||||||
// standard transform
|
// standard transform
|
||||||
TransformCamera cam = getTransformCamera();
|
TransformCamera cam = getTransformCamera();
|
||||||
vec3 clipDir = vec3(inPosition.xy, 0.0);
|
vec3 clipDir = vec3(inPosition.xy, 0.0);
|
||||||
vec3 eyeDir;
|
vec3 eyeDir;
|
||||||
|
|
||||||
<$transformClipToEyeDir(cam, clipDir, eyeDir)$>
|
<$transformClipToEyeDir(cam, clipDir, eyeDir)$>
|
||||||
<$transformEyeToWorldDir(cam, eyeDir, _normal)$>
|
<$transformEyeToWorldDir(cam, eyeDir, _normal)$>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue