mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 14:20:33 +02:00
trying to remove the 24bits formats
This commit is contained in:
parent
2975f73fc9
commit
7b49f548ed
2 changed files with 21 additions and 9 deletions
|
@ -113,7 +113,6 @@ void GLTextureTransferHelper::queueExecution(VoidLambda lambda) {
|
||||||
#define MAX_TRANSFERS_PER_PASS 2
|
#define MAX_TRANSFERS_PER_PASS 2
|
||||||
|
|
||||||
bool GLTextureTransferHelper::process() {
|
bool GLTextureTransferHelper::process() {
|
||||||
PROFILE_RANGE(render_gpu_gl, __FUNCTION__)
|
|
||||||
// Take any new textures or commands off the queue
|
// Take any new textures or commands off the queue
|
||||||
VoidLambdaList pendingCommands;
|
VoidLambdaList pendingCommands;
|
||||||
TextureList newTransferTextures;
|
TextureList newTransferTextures;
|
||||||
|
|
|
@ -334,15 +334,20 @@ gpu::Texture* TextureUsage::createNormalTextureFromNormalImage(const QImage& src
|
||||||
PROFILE_RANGE(resource_parse, "createNormalTextureFromNormalImage");
|
PROFILE_RANGE(resource_parse, "createNormalTextureFromNormalImage");
|
||||||
QImage image = processSourceImage(srcImage, false);
|
QImage image = processSourceImage(srcImage, false);
|
||||||
|
|
||||||
if (image.format() != QImage::Format_RGB888) {
|
/* if (image.format() != QImage::Format_RGB888) {
|
||||||
image = image.convertToFormat(QImage::Format_RGB888);
|
image = image.convertToFormat(QImage::Format_RGB888);
|
||||||
|
}*/
|
||||||
|
if (image.format() != QImage::Format_ARGB32) {
|
||||||
|
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* theTexture = nullptr;
|
gpu::Texture* theTexture = nullptr;
|
||||||
if ((image.width() > 0) && (image.height() > 0)) {
|
if ((image.width() > 0) && (image.height() > 0)) {
|
||||||
|
|
||||||
gpu::Element formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
// gpu::Element formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
||||||
gpu::Element formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
// gpu::Element formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
||||||
|
gpu::Element formatGPU = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
|
||||||
|
gpu::Element formatMip = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
|
||||||
|
|
||||||
theTexture = (gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR)));
|
theTexture = (gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR)));
|
||||||
theTexture->setSource(srcImageName);
|
theTexture->setSource(srcImageName);
|
||||||
|
@ -378,7 +383,8 @@ gpu::Texture* TextureUsage::createNormalTextureFromBumpImage(const QImage& srcIm
|
||||||
const double pStrength = 2.0;
|
const double pStrength = 2.0;
|
||||||
int width = image.width();
|
int width = image.width();
|
||||||
int height = image.height();
|
int height = image.height();
|
||||||
QImage result(width, height, QImage::Format_RGB888);
|
//QImage result(width, height, QImage::Format_RGB888);
|
||||||
|
QImage result(width, height, QImage::Format_ARGB32);
|
||||||
|
|
||||||
for (int i = 0; i < width; i++) {
|
for (int i = 0; i < width; i++) {
|
||||||
const int iNextClamped = clampPixelCoordinate(i + 1, width - 1);
|
const int iNextClamped = clampPixelCoordinate(i + 1, width - 1);
|
||||||
|
@ -426,8 +432,11 @@ gpu::Texture* TextureUsage::createNormalTextureFromBumpImage(const QImage& srcIm
|
||||||
gpu::Texture* theTexture = nullptr;
|
gpu::Texture* theTexture = nullptr;
|
||||||
if ((image.width() > 0) && (image.height() > 0)) {
|
if ((image.width() > 0) && (image.height() > 0)) {
|
||||||
|
|
||||||
gpu::Element formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
|
||||||
gpu::Element formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
// gpu::Element formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
||||||
|
// gpu::Element formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::RGB);
|
||||||
|
gpu::Element formatGPU = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
|
||||||
|
gpu::Element formatMip = gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA);
|
||||||
|
|
||||||
theTexture = (gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR)));
|
theTexture = (gpu::Texture::create2D(formatGPU, image.width(), image.height(), gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR)));
|
||||||
theTexture->setSource(srcImageName);
|
theTexture->setSource(srcImageName);
|
||||||
|
@ -810,10 +819,14 @@ gpu::Texture* TextureUsage::processCubeTextureColorFromImage(const QImage& srcIm
|
||||||
gpu::Texture* theTexture = nullptr;
|
gpu::Texture* theTexture = nullptr;
|
||||||
if ((srcImage.width() > 0) && (srcImage.height() > 0)) {
|
if ((srcImage.width() > 0) && (srcImage.height() > 0)) {
|
||||||
QImage image = processSourceImage(srcImage, true);
|
QImage image = processSourceImage(srcImage, true);
|
||||||
if (image.format() != QImage::Format_RGB888) {
|
if (image.format() != QImage::Format_ARGB32) {
|
||||||
image = image.convertToFormat(QImage::Format_RGB888);
|
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if (image.format() != QImage::Format_RGB888) {
|
||||||
|
image = image.convertToFormat(QImage::Format_RGB888);
|
||||||
|
}*/
|
||||||
|
|
||||||
gpu::Element formatGPU;
|
gpu::Element formatGPU;
|
||||||
gpu::Element formatMip;
|
gpu::Element formatMip;
|
||||||
defineColorTexelFormats(formatGPU, formatMip, image, isLinear, doCompress);
|
defineColorTexelFormats(formatGPU, formatMip, image, isLinear, doCompress);
|
||||||
|
|
Loading…
Reference in a new issue