mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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);
|
||||
}
|
||||
}
|
||||
{
|
||||
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");
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include <Profile.h>
|
||||
#include <StatTracker.h>
|
||||
#include <GLMHelpers.h>
|
||||
#include <SettingHandle.h>
|
||||
|
||||
#include "ImageLogging.h"
|
||||
|
||||
|
@ -30,18 +29,17 @@ using namespace gpu;
|
|||
|
||||
#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 MAX_TEXTURE_SIZE(4096);
|
||||
bool DEV_DECIMATE_TEXTURES = false;
|
||||
std::atomic<size_t> DECIMATED_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) {
|
||||
// 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))) {
|
||||
|
@ -150,8 +148,7 @@ gpu::TexturePointer TextureUsage::createCubeTextureFromImageWithoutIrradiance(co
|
|||
|
||||
bool isColorTexturesCompressionEnabled() {
|
||||
#if CPU_MIPMAPS
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
return compressColorTextures.get();
|
||||
return compressColorTextures;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -159,8 +156,7 @@ bool isColorTexturesCompressionEnabled() {
|
|||
|
||||
bool isNormalTexturesCompressionEnabled() {
|
||||
#if CPU_MIPMAPS
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
return compressNormalTextures.get();
|
||||
return compressNormalTextures;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -168,8 +164,7 @@ bool isNormalTexturesCompressionEnabled() {
|
|||
|
||||
bool isGrayscaleTexturesCompressionEnabled() {
|
||||
#if CPU_MIPMAPS
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
return compressGrayscaleTextures.get();
|
||||
return compressGrayscaleTextures;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -177,31 +172,26 @@ bool isGrayscaleTexturesCompressionEnabled() {
|
|||
|
||||
bool isCubeTexturesCompressionEnabled() {
|
||||
#if CPU_MIPMAPS
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
return compressCubeTextures.get();
|
||||
return compressCubeTextures;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void setColorTexturesCompressionEnabled(bool enabled) {
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
compressColorTextures.set(enabled);
|
||||
compressColorTextures = enabled;
|
||||
}
|
||||
|
||||
void setNormalTexturesCompressionEnabled(bool enabled) {
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
compressNormalTextures.set(enabled);
|
||||
compressNormalTextures = enabled;
|
||||
}
|
||||
|
||||
void setGrayscaleTexturesCompressionEnabled(bool enabled) {
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
compressGrayscaleTextures.set(enabled);
|
||||
compressGrayscaleTextures = enabled;
|
||||
}
|
||||
|
||||
void setCubeTexturesCompressionEnabled(bool enabled) {
|
||||
std::lock_guard<std::mutex> guard(settingsMutex);
|
||||
compressCubeTextures.set(enabled);
|
||||
compressCubeTextures = enabled;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue