diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45Backend.h b/libraries/gpu-gl/src/gpu/gl45/GL45Backend.h index 0f61cd1ab9..b684a9b8d2 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45Backend.h +++ b/libraries/gpu-gl/src/gpu/gl45/GL45Backend.h @@ -31,6 +31,7 @@ public: using Parent = GLTexture; static GLuint allocate(const Texture& texture); static const uint32_t DEFAULT_PAGE_DIMENSION = 128; + static const uint32_t DEFAULT_MAX_SPARSE_LEVEL = 0xFFFF; public: GL45Texture(const std::weak_ptr& backend, const Texture& texture, bool transferrable); ~GL45Texture(); @@ -40,7 +41,7 @@ public: struct SparseInfo { GL45Texture& _texture; uvec3 _pageDimensions { DEFAULT_PAGE_DIMENSION }; - GLuint _maxSparseLevel { 0 }; + GLuint _maxSparseLevel { DEFAULT_MAX_SPARSE_LEVEL }; uint32_t _maxPages { 0 }; uint32_t _pageBytes { 0 }; bool _sparse { false }; diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp index 79f4615317..09c6003ced 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp @@ -98,11 +98,6 @@ void SparseInfo::maybeMakeSparse() { return; } - if (GL_TEXTURE_CUBE_MAP == _texture._target) { - qCDebug(gpugl45logging) << "Don't enable sparse texture for cubemaps " << _texture._gpuObject.source().c_str(); - return; - } - const uvec3 dimensions = _texture._gpuObject.getDimensions(); auto allowedPageDimensions = getPageDimensionsForFormat(_texture._target, _texture._internalFormat); // In order to enable sparse the texture size must be an integer multiple of the page size @@ -132,11 +127,6 @@ void SparseInfo::update() { return; } glGetTextureParameterIuiv(_texture._id, GL_NUM_SPARSE_LEVELS_ARB, &_maxSparseLevel); - // For some reason the long mip tail isn't working properly with cubemaps unless - // I extend one more level - if (GL_TEXTURE_CUBE_MAP == _texture._target) { - ++_maxSparseLevel; - } _pageBytes = _texture._gpuObject.getTexelFormat().getSize(); _pageBytes *= _pageDimensions.x * _pageDimensions.y * _pageDimensions.z; diff --git a/libraries/model/src/model/skybox.slf b/libraries/model/src/model/skybox.slf index 7b25e36af7..c0770525f7 100755 --- a/libraries/model/src/model/skybox.slf +++ b/libraries/model/src/model/skybox.slf @@ -48,7 +48,7 @@ void main(void) { // blend is only set if there is a cubemap if (skybox.color.a > 0.0) { - color = texture(cubeMap, coord).rgb; + color = textureLod(cubeMap, coord, 0).rgb; if (skybox.color.a < 1.0) { color *= skybox.color.rgb; } diff --git a/tests/render-perf/src/Camera.hpp b/tests/render-perf/src/Camera.hpp index ebfcfb9e32..6e1d95bfe1 100644 --- a/tests/render-perf/src/Camera.hpp +++ b/tests/render-perf/src/Camera.hpp @@ -14,9 +14,10 @@ protected: public: glm::quat getOrientation() const { - return glm::angleAxis(yaw, Vectors::UP); + return glm::angleAxis(yawPitch.x, Vectors::UP) * glm::angleAxis(yawPitch.y, Vectors::RIGHT); } - float yaw { 0 }; + + vec2 yawPitch { 0 }; glm::vec3 position; float rotationSpeed { 1.0f }; float movementSpeed { 1.0f }; @@ -76,7 +77,12 @@ public: }; void rotate(const float delta) { - yaw += delta; + yawPitch.x += delta; + updateViewMatrix(); + } + + void rotate(const glm::vec2& delta) { + yawPitch += delta; updateViewMatrix(); } @@ -84,7 +90,11 @@ public: glm::vec3 f = rotation * Vectors::UNIT_NEG_Z; f.y = 0; f = glm::normalize(f); - yaw = angleBetween(Vectors::UNIT_NEG_Z, f); + yawPitch.x = angleBetween(Vectors::UNIT_NEG_Z, f); + f = rotation * Vectors::UNIT_NEG_Z; + f.x = 0; + f = glm::normalize(f); + yawPitch.y = angleBetween(Vectors::UNIT_NEG_Z, f); updateViewMatrix(); } diff --git a/tests/render-perf/src/main.cpp b/tests/render-perf/src/main.cpp index bbe1c33bb1..605ccf3787 100644 --- a/tests/render-perf/src/main.cpp +++ b/tests/render-perf/src/main.cpp @@ -188,7 +188,8 @@ public: if (buttons & Qt::RightButton) { dolly(delta.y * 0.01f); } else if (buttons & Qt::LeftButton) { - rotate(delta.x * -0.01f); + //rotate(delta.x * -0.01f); + rotate(delta * -0.01f); } else if (buttons & Qt::MiddleButton) { delta.y *= -1.0f; translate(delta * -0.01f); @@ -367,7 +368,7 @@ public: sortedHighFrames.sort(); for (const auto& t : sortedHighFrames) { - qDebug() << "Long frame " << t; + //qDebug() << "Long frame " << t; } } @@ -990,7 +991,7 @@ private: } void resetPosition() { - _camera.yaw = 0; + _camera.yawPitch = vec3(0); _camera.setPosition(vec3()); }