Getting closer to a solution

This commit is contained in:
Zach Fox 2017-06-13 11:37:27 -07:00
parent 4acbb81413
commit 7b6033f7bc
3 changed files with 3 additions and 7 deletions

View file

@ -78,6 +78,7 @@ public:
auto srcViewFrustum = args->getViewFrustum();
srcViewFrustum.setPosition(_position);
srcViewFrustum.setOrientation(_orientation);
srcViewFrustum.setProjection(glm::perspective(45.0f, ((float)args->_viewport.z / (float)args->_viewport.w), 0.1f, 100.0f));
// Without calculating the bound planes, the secondary camera will use the same culling frustum as the main camera,
// which is not what we want here.
srcViewFrustum.calculate();

View file

@ -420,8 +420,7 @@ model::MeshPointer DeferredLightingEffect::getSpotLightMesh() {
void PreparePrimaryFramebuffer::run(const RenderContextPointer& renderContext, gpu::FramebufferPointer& primaryFramebuffer) {
auto framebufferCache = DependencyManager::get<FramebufferCache>();
auto framebufferSize = framebufferCache->getFrameBufferSize();
glm::uvec2 frameSize(framebufferSize.width(), framebufferSize.height());
glm::uvec2 frameSize(renderContext->args->_viewport.z, renderContext->args->_viewport.w);
// Resizing framebuffers instead of re-building them seems to cause issues with threaded
// rendering

View file

@ -133,12 +133,8 @@
parentID: camera,
alpha: 1,
position: { x: 0.007, y: 0.15, z: -0.005 },
dimensions: { x: 0.16, y: -0.16 * windowAspectRatio / previewAspectRatio, z: 0 }
dimensions: { x: 0.16, y: 0.16 * windowAspectRatio / previewAspectRatio, z: 0 }
// FIXME: This stretches the preview.
// FIXME: We shouldn't need the negative dimension.
// e.g., This isn't necessary using an ordinary .jpg with lettering, above.
// Must be something about the view frustum projection matrix?
// But don't go changing that in (c++ code) without getting all the way to a desktop display!
});
Entities.editEntity(camera, { position: cameraPosition, rotation: cameraRotation });
setDisplay(monitorShowsCameraView);