mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:57:30 +02:00
fix build buster
This commit is contained in:
parent
c3d1d13fa9
commit
ac3a963eca
2 changed files with 60 additions and 30 deletions
|
@ -35,6 +35,7 @@ using namespace std;
|
||||||
static int modelPointerTypeId = qRegisterMetaType<QPointer<Model> >();
|
static int modelPointerTypeId = qRegisterMetaType<QPointer<Model> >();
|
||||||
static int weakNetworkGeometryPointerTypeId = qRegisterMetaType<QWeakPointer<NetworkGeometry> >();
|
static int weakNetworkGeometryPointerTypeId = qRegisterMetaType<QWeakPointer<NetworkGeometry> >();
|
||||||
static int vec3VectorTypeId = qRegisterMetaType<QVector<glm::vec3> >();
|
static int vec3VectorTypeId = qRegisterMetaType<QVector<glm::vec3> >();
|
||||||
|
float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f;
|
||||||
|
|
||||||
Model::Model(QObject* parent) :
|
Model::Model(QObject* parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
|
@ -123,35 +124,64 @@ void Model::setOffset(const glm::vec3& offset) {
|
||||||
void Model::initProgram(ProgramObject& program, Model::Locations& locations, int specularTextureUnit) {
|
void Model::initProgram(ProgramObject& program, Model::Locations& locations, int specularTextureUnit) {
|
||||||
program.bind();
|
program.bind();
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
// HACK: Assign explicitely the attribute channel to avoid a bug on Yosemite
|
|
||||||
glBindAttribLocation(program.programId(), 4, "tangent");
|
// HACK: Assign explicitely the attribute channel to avoid a bug on Yosemite
|
||||||
glLinkProgram(program.programId());
|
|
||||||
#endif
|
glBindAttribLocation(program.programId(), 4, "tangent");
|
||||||
|
|
||||||
locations.tangent = program.attributeLocation("tangent");
|
glLinkProgram(program.programId());
|
||||||
locations.alphaThreshold = program.uniformLocation("alphaThreshold");
|
|
||||||
program.setUniformValue("diffuseMap", 0);
|
#endif
|
||||||
program.setUniformValue("normalMap", 1);
|
|
||||||
program.setUniformValue("specularMap", specularTextureUnit);
|
|
||||||
program.release();
|
|
||||||
}
|
locations.tangent = program.attributeLocation("tangent");
|
||||||
|
|
||||||
void Model::initSkinProgram(ProgramObject& program, Model::SkinLocations& locations, int specularTextureUnit) {
|
locations.alphaThreshold = program.uniformLocation("alphaThreshold");
|
||||||
initProgram(program, locations, specularTextureUnit);
|
|
||||||
|
program.setUniformValue("diffuseMap", 0);
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// HACK: Assign explicitely the attribute channel to avoid a bug on Yosemite
|
program.setUniformValue("normalMap", 1);
|
||||||
glBindAttribLocation(program.programId(), 5, "clusterIndices");
|
|
||||||
glBindAttribLocation(program.programId(), 6, "clusterWeights");
|
program.setUniformValue("specularMap", specularTextureUnit);
|
||||||
glLinkProgram(program.programId());
|
|
||||||
#endif
|
program.release();
|
||||||
|
|
||||||
program.bind();
|
}
|
||||||
locations.clusterMatrices = program.uniformLocation("clusterMatrices");
|
|
||||||
|
|
||||||
locations.clusterIndices = program.attributeLocation("clusterIndices");
|
|
||||||
locations.clusterWeights = program.attributeLocation("clusterWeights");
|
void Model::initSkinProgram(ProgramObject& program, Model::SkinLocations& locations, int specularTextureUnit) {
|
||||||
|
|
||||||
|
initProgram(program, locations, specularTextureUnit);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
|
||||||
|
// HACK: Assign explicitely the attribute channel to avoid a bug on Yosemite
|
||||||
|
|
||||||
|
glBindAttribLocation(program.programId(), 5, "clusterIndices");
|
||||||
|
|
||||||
|
glBindAttribLocation(program.programId(), 6, "clusterWeights");
|
||||||
|
|
||||||
|
glLinkProgram(program.programId());
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
program.bind();
|
||||||
|
|
||||||
|
locations.clusterMatrices = program.uniformLocation("clusterMatrices");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
locations.clusterIndices = program.attributeLocation("clusterIndices");
|
||||||
|
|
||||||
|
locations.clusterWeights = program.attributeLocation("clusterWeights");
|
||||||
|
|
||||||
program.release();
|
program.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ protected:
|
||||||
glm::vec3 _scale;
|
glm::vec3 _scale;
|
||||||
glm::vec3 _offset;
|
glm::vec3 _offset;
|
||||||
|
|
||||||
const float FAKE_DIMENSION_PLACEHOLDER = -1.0f;
|
static float FAKE_DIMENSION_PLACEHOLDER;
|
||||||
|
|
||||||
bool _scaleToFit; /// If you set scaleToFit, we will calculate scale based on MeshExtents
|
bool _scaleToFit; /// If you set scaleToFit, we will calculate scale based on MeshExtents
|
||||||
glm::vec3 _scaleToFitDimensions; /// this is the dimensions that scale to fit will use
|
glm::vec3 _scaleToFitDimensions; /// this is the dimensions that scale to fit will use
|
||||||
|
|
Loading…
Reference in a new issue