mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:17:14 +02:00
fix references to moved texture type enum
This commit is contained in:
parent
93c35314ec
commit
0b4a8d05aa
7 changed files with 13 additions and 12 deletions
|
@ -37,7 +37,8 @@ enum Type {
|
||||||
CUBE_TEXTURE,
|
CUBE_TEXTURE,
|
||||||
OCCLUSION_TEXTURE,
|
OCCLUSION_TEXTURE,
|
||||||
SCATTERING_TEXTURE = OCCLUSION_TEXTURE,
|
SCATTERING_TEXTURE = OCCLUSION_TEXTURE,
|
||||||
LIGHTMAP_TEXTURE
|
LIGHTMAP_TEXTURE,
|
||||||
|
UNUSED_TEXTURE
|
||||||
};
|
};
|
||||||
|
|
||||||
using TextureLoader = std::function<gpu::TexturePointer(const QImage&, const std::string&)>;
|
using TextureLoader = std::function<gpu::TexturePointer(const QImage&, const std::string&)>;
|
||||||
|
|
|
@ -239,7 +239,7 @@ void DomainBaker::bakeSkybox(QUrl skyboxURL, QJsonValueRef entity) {
|
||||||
// setup a baker for this skybox
|
// setup a baker for this skybox
|
||||||
|
|
||||||
QSharedPointer<TextureBaker> skyboxBaker {
|
QSharedPointer<TextureBaker> skyboxBaker {
|
||||||
new TextureBaker(skyboxURL, gpu::CUBE_TEXTURE, _contentOutputPath),
|
new TextureBaker(skyboxURL, image::TextureUsage::CUBE_TEXTURE, _contentOutputPath),
|
||||||
&TextureBaker::deleteLater
|
&TextureBaker::deleteLater
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -277,8 +277,8 @@ QUrl FBXBaker::getTextureURL(const QFileInfo& textureFileInfo, FbxFileTexture* f
|
||||||
return urlToTexture;
|
return urlToTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::TextureType textureTypeForMaterialProperty(FbxProperty& property, FbxSurfaceMaterial* material) {
|
image::TextureUsage::Type textureTypeForMaterialProperty(FbxProperty& property, FbxSurfaceMaterial* material) {
|
||||||
using namespace gpu;
|
using namespace image::TextureUsage;
|
||||||
|
|
||||||
// this is a property we know has a texture, we need to match it to a High Fidelity known texture type
|
// this is a property we know has a texture, we need to match it to a High Fidelity known texture type
|
||||||
// since that information is passed to the baking process
|
// since that information is passed to the baking process
|
||||||
|
@ -347,7 +347,7 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
// figure out the type of texture from the material property
|
// figure out the type of texture from the material property
|
||||||
auto textureType = textureTypeForMaterialProperty(property, material);
|
auto textureType = textureTypeForMaterialProperty(property, material);
|
||||||
|
|
||||||
if (textureType != gpu::UNUSED_TEXTURE) {
|
if (textureType != image::TextureUsage::UNUSED_TEXTURE) {
|
||||||
int numTextures = property.GetSrcObjectCount<FbxFileTexture>();
|
int numTextures = property.GetSrcObjectCount<FbxFileTexture>();
|
||||||
|
|
||||||
for (int j = 0; j < numTextures; j++) {
|
for (int j = 0; j < numTextures; j++) {
|
||||||
|
@ -393,7 +393,7 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FBXBaker::bakeTexture(const QUrl& textureURL, gpu::TextureType textureType, const QDir& outputDir) {
|
void FBXBaker::bakeTexture(const QUrl& textureURL, image::TextureUsage::Type textureType, const QDir& outputDir) {
|
||||||
// start a bake for this texture and add it to our list to keep track of
|
// start a bake for this texture and add it to our list to keep track of
|
||||||
QSharedPointer<TextureBaker> bakingTexture {
|
QSharedPointer<TextureBaker> bakingTexture {
|
||||||
new TextureBaker(textureURL, textureType, outputDir),
|
new TextureBaker(textureURL, textureType, outputDir),
|
||||||
|
|
|
@ -74,7 +74,7 @@ private:
|
||||||
QString createBakedTextureFileName(const QFileInfo& textureFileInfo);
|
QString createBakedTextureFileName(const QFileInfo& textureFileInfo);
|
||||||
QUrl getTextureURL(const QFileInfo& textureFileInfo, fbxsdk::FbxFileTexture* fileTexture);
|
QUrl getTextureURL(const QFileInfo& textureFileInfo, fbxsdk::FbxFileTexture* fileTexture);
|
||||||
|
|
||||||
void bakeTexture(const QUrl& textureURL, gpu::TextureType textureType, const QDir& outputDir);
|
void bakeTexture(const QUrl& textureURL, image::TextureUsage::Type textureType, const QDir& outputDir);
|
||||||
|
|
||||||
QString pathToCopyOfOriginal() const;
|
QString pathToCopyOfOriginal() const;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
const QString BAKED_TEXTURE_EXT = ".ktx";
|
const QString BAKED_TEXTURE_EXT = ".ktx";
|
||||||
|
|
||||||
TextureBaker::TextureBaker(const QUrl& textureURL, gpu::TextureType textureType, const QDir& outputDirectory) :
|
TextureBaker::TextureBaker(const QUrl& textureURL, image::TextureUsage::Type textureType, const QDir& outputDirectory) :
|
||||||
_textureURL(textureURL),
|
_textureURL(textureURL),
|
||||||
_textureType(textureType),
|
_textureType(textureType),
|
||||||
_outputDirectory(outputDirectory)
|
_outputDirectory(outputDirectory)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
#include <QtCore/QRunnable>
|
#include <QtCore/QRunnable>
|
||||||
|
|
||||||
#include <gpu/Texture.h>
|
#include <image/Image.h>
|
||||||
|
|
||||||
#include "Baker.h"
|
#include "Baker.h"
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class TextureBaker : public Baker {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextureBaker(const QUrl& textureURL, gpu::TextureType textureType, const QDir& outputDirectory);
|
TextureBaker(const QUrl& textureURL, image::TextureUsage::Type textureType, const QDir& outputDirectory);
|
||||||
|
|
||||||
const QByteArray& getOriginalTexture() const { return _originalTexture; }
|
const QByteArray& getOriginalTexture() const { return _originalTexture; }
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ private:
|
||||||
|
|
||||||
QUrl _textureURL;
|
QUrl _textureURL;
|
||||||
QByteArray _originalTexture;
|
QByteArray _originalTexture;
|
||||||
gpu::TextureType _textureType;
|
image::TextureUsage::Type _textureType;
|
||||||
|
|
||||||
QDir _outputDirectory;
|
QDir _outputDirectory;
|
||||||
QString _bakedTextureFileName;
|
QString _bakedTextureFileName;
|
||||||
|
|
|
@ -177,7 +177,7 @@ void SkyboxBakeWidget::bakeButtonClicked() {
|
||||||
|
|
||||||
// everything seems to be in place, kick off a bake for this skybox now
|
// everything seems to be in place, kick off a bake for this skybox now
|
||||||
auto baker = std::unique_ptr<TextureBaker> {
|
auto baker = std::unique_ptr<TextureBaker> {
|
||||||
new TextureBaker(skyboxToBakeURL, gpu::CUBE_TEXTURE, outputDirectory.absolutePath())
|
new TextureBaker(skyboxToBakeURL, image::TextureUsage::CUBE_TEXTURE, outputDirectory.absolutePath())
|
||||||
};
|
};
|
||||||
|
|
||||||
// move the baker to a worker thread
|
// move the baker to a worker thread
|
||||||
|
|
Loading…
Reference in a new issue