mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 14:41:19 +02:00
remove image compression choices from Interface settings
This commit is contained in:
parent
e25b4700d9
commit
7859b3b11f
2 changed files with 13 additions and 47 deletions
|
@ -333,30 +333,6 @@ void setupPreferences() {
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
auto getter = []()->bool { return image::isColorTexturesCompressionEnabled(); };
|
|
||||||
auto setter = [](bool value) { return image::setColorTexturesCompressionEnabled(value); };
|
|
||||||
auto preference = new CheckPreference(RENDER, "Compress Color Textures", getter, setter);
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto getter = []()->bool { return image::isNormalTexturesCompressionEnabled(); };
|
|
||||||
auto setter = [](bool value) { return image::setNormalTexturesCompressionEnabled(value); };
|
|
||||||
auto preference = new CheckPreference(RENDER, "Compress Normal Textures", getter, setter);
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto getter = []()->bool { return image::isGrayscaleTexturesCompressionEnabled(); };
|
|
||||||
auto setter = [](bool value) { return image::setGrayscaleTexturesCompressionEnabled(value); };
|
|
||||||
auto preference = new CheckPreference(RENDER, "Compress Grayscale Textures", getter, setter);
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
auto getter = []()->bool { return image::isCubeTexturesCompressionEnabled(); };
|
|
||||||
auto setter = [](bool value) { return image::setCubeTexturesCompressionEnabled(value); };
|
|
||||||
auto preference = new CheckPreference(RENDER, "Compress Cube Textures", getter, setter);
|
|
||||||
preferences->addPreference(preference);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
static const QString RENDER("Networking");
|
static const QString RENDER("Networking");
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <Profile.h>
|
#include <Profile.h>
|
||||||
#include <StatTracker.h>
|
#include <StatTracker.h>
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
#include <SettingHandle.h>
|
|
||||||
|
|
||||||
#include "ImageLogging.h"
|
#include "ImageLogging.h"
|
||||||
|
|
||||||
|
@ -30,18 +29,17 @@ using namespace gpu;
|
||||||
|
|
||||||
#define CPU_MIPMAPS 1
|
#define CPU_MIPMAPS 1
|
||||||
|
|
||||||
static std::mutex settingsMutex;
|
|
||||||
static Setting::Handle<bool> compressColorTextures("hifi.graphics.compressColorTextures", false);
|
|
||||||
static Setting::Handle<bool> compressNormalTextures("hifi.graphics.compressNormalTextures", false);
|
|
||||||
static Setting::Handle<bool> compressGrayscaleTextures("hifi.graphics.compressGrayscaleTextures", false);
|
|
||||||
static Setting::Handle<bool> compressCubeTextures("hifi.graphics.compressCubeTextures", false);
|
|
||||||
|
|
||||||
static const glm::uvec2 SPARSE_PAGE_SIZE(128);
|
static const glm::uvec2 SPARSE_PAGE_SIZE(128);
|
||||||
static const glm::uvec2 MAX_TEXTURE_SIZE(4096);
|
static const glm::uvec2 MAX_TEXTURE_SIZE(4096);
|
||||||
bool DEV_DECIMATE_TEXTURES = false;
|
bool DEV_DECIMATE_TEXTURES = false;
|
||||||
std::atomic<size_t> DECIMATED_TEXTURE_COUNT{ 0 };
|
std::atomic<size_t> DECIMATED_TEXTURE_COUNT{ 0 };
|
||||||
std::atomic<size_t> RECTIFIED_TEXTURE_COUNT{ 0 };
|
std::atomic<size_t> RECTIFIED_TEXTURE_COUNT{ 0 };
|
||||||
|
|
||||||
|
static std::atomic<bool> compressColorTextures { false };
|
||||||
|
static std::atomic<bool> compressNormalTextures { false };
|
||||||
|
static std::atomic<bool> compressGrayscaleTextures { false };
|
||||||
|
static std::atomic<bool> compressCubeTextures { false };
|
||||||
|
|
||||||
bool needsSparseRectification(const glm::uvec2& size) {
|
bool needsSparseRectification(const glm::uvec2& size) {
|
||||||
// Don't attempt to rectify small textures (textures less than the sparse page size in any dimension)
|
// Don't attempt to rectify small textures (textures less than the sparse page size in any dimension)
|
||||||
if (glm::any(glm::lessThan(size, SPARSE_PAGE_SIZE))) {
|
if (glm::any(glm::lessThan(size, SPARSE_PAGE_SIZE))) {
|
||||||
|
@ -150,8 +148,7 @@ gpu::TexturePointer TextureUsage::createCubeTextureFromImageWithoutIrradiance(co
|
||||||
|
|
||||||
bool isColorTexturesCompressionEnabled() {
|
bool isColorTexturesCompressionEnabled() {
|
||||||
#if CPU_MIPMAPS
|
#if CPU_MIPMAPS
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
return compressColorTextures;
|
||||||
return compressColorTextures.get();
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -159,8 +156,7 @@ bool isColorTexturesCompressionEnabled() {
|
||||||
|
|
||||||
bool isNormalTexturesCompressionEnabled() {
|
bool isNormalTexturesCompressionEnabled() {
|
||||||
#if CPU_MIPMAPS
|
#if CPU_MIPMAPS
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
return compressNormalTextures;
|
||||||
return compressNormalTextures.get();
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -168,8 +164,7 @@ bool isNormalTexturesCompressionEnabled() {
|
||||||
|
|
||||||
bool isGrayscaleTexturesCompressionEnabled() {
|
bool isGrayscaleTexturesCompressionEnabled() {
|
||||||
#if CPU_MIPMAPS
|
#if CPU_MIPMAPS
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
return compressGrayscaleTextures;
|
||||||
return compressGrayscaleTextures.get();
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,31 +172,26 @@ bool isGrayscaleTexturesCompressionEnabled() {
|
||||||
|
|
||||||
bool isCubeTexturesCompressionEnabled() {
|
bool isCubeTexturesCompressionEnabled() {
|
||||||
#if CPU_MIPMAPS
|
#if CPU_MIPMAPS
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
return compressCubeTextures;
|
||||||
return compressCubeTextures.get();
|
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void setColorTexturesCompressionEnabled(bool enabled) {
|
void setColorTexturesCompressionEnabled(bool enabled) {
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
compressColorTextures = enabled;
|
||||||
compressColorTextures.set(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setNormalTexturesCompressionEnabled(bool enabled) {
|
void setNormalTexturesCompressionEnabled(bool enabled) {
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
compressNormalTextures = enabled;
|
||||||
compressNormalTextures.set(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setGrayscaleTexturesCompressionEnabled(bool enabled) {
|
void setGrayscaleTexturesCompressionEnabled(bool enabled) {
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
compressGrayscaleTextures = enabled;
|
||||||
compressGrayscaleTextures.set(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCubeTexturesCompressionEnabled(bool enabled) {
|
void setCubeTexturesCompressionEnabled(bool enabled) {
|
||||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
compressCubeTextures = enabled;
|
||||||
compressCubeTextures.set(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue