Merge branch 'master' of https://github.com/highfidelity/hifi into orange

This commit is contained in:
samcake 2016-03-22 16:51:32 -07:00
commit 34633c2f19
8 changed files with 22 additions and 16 deletions

View file

@ -968,9 +968,10 @@ bool AvatarData::hasIdentityChangedAfterParsing(const QByteArray& data) {
bool hasIdentityChanged = false;
if (skeletonModelURL != _skeletonModelURL) {
if (_firstSkeletonCheck || (skeletonModelURL != _skeletonModelURL)) {
setSkeletonModelURL(skeletonModelURL);
hasIdentityChanged = true;
_firstSkeletonCheck = false;
}
if (displayName != _displayName) {

View file

@ -368,7 +368,8 @@ protected:
HeadData* _headData;
QUrl _skeletonModelURL; // These need to be empty so that on first time setting them they will not short circuit
QUrl _skeletonModelURL;
bool _firstSkeletonCheck { true };
QUrl _skeletonFBXURL;
QVector<AttachmentData> _attachmentData;
QString _displayName;

View file

@ -78,10 +78,14 @@ bool FBXGeometry::convexHullContains(const glm::vec3& point) const {
auto checkEachPrimitive = [=](FBXMesh& mesh, QVector<int> indices, int primitiveSize) -> bool {
// Check whether the point is "behind" all the primitives.
int verticesSize = mesh.vertices.size();
for (int j = 0;
j < indices.size() - 2; // -2 in case the vertices aren't the right size -- we access j + 2 below
j += primitiveSize) {
if (!isPointBehindTrianglesPlane(point,
if (indices[j] < verticesSize &&
indices[j + 1] < verticesSize &&
indices[j + 2] < verticesSize &&
!isPointBehindTrianglesPlane(point,
mesh.vertices[indices[j]],
mesh.vertices[indices[j + 1]],
mesh.vertices[indices[j + 2]])) {

View file

@ -44,12 +44,6 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) {
return true;
}
qWarning() << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qWarning() << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
qWarning() << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
qWarning() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
qWarning() << "Failed to create OffscreenGLCanvas";
return false;
}

View file

@ -187,6 +187,15 @@ bool OffscreenQmlRenderThread::event(QEvent *e) {
void OffscreenQmlRenderThread::setupFbo() {
using namespace oglplus;
_textures.setSize(_size);
// Before making any ogl calls, clear any outstanding errors
// FIXME: Something upstream is polluting the context with a GL_INVALID_ENUM,
// likely from glewExperimental = true
GLenum err = glGetError();
if (err != GL_NO_ERROR) {
qDebug() << "Clearing outstanding GL error to set up QML FBO:" << glewGetErrorString(err);
}
_depthStencil.reset(new Renderbuffer());
Context::Bound(Renderbuffer::Target::Renderbuffer, *_depthStencil)
.Storage(

View file

@ -87,18 +87,15 @@ void GLBackend::init() {
static std::once_flag once;
std::call_once(once, [] {
qCDebug(gpulogging) << "GL Version: " << QString((const char*) glGetString(GL_VERSION));
qCDebug(gpulogging) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
qCDebug(gpulogging) << "GL Vendor: " << QString((const char*) glGetString(GL_VENDOR));
qCDebug(gpulogging) << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
glewExperimental = true;
GLenum err = glewInit();
glGetError();
glGetError(); // clear the potential error from glewExperimental
if (GLEW_OK != err) {
/* Problem: glewInit failed, something is seriously wrong. */
// glewInit failed, something is seriously wrong.
qCDebug(gpulogging, "Error: %s\n", glewGetErrorString(err));
}
qCDebug(gpulogging, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));

View file

@ -30,7 +30,7 @@ bool OculusBaseDisplayPlugin::isSupported() const {
void OculusBaseDisplayPlugin::customizeContext() {
glewExperimental = true;
GLenum err = glewInit();
glGetError();
glGetError(); // clear the potential error from glewExperimental
Parent::customizeContext();
}

View file

@ -101,7 +101,7 @@ void OpenVrDisplayPlugin::customizeContext() {
std::call_once(once, []{
glewExperimental = true;
GLenum err = glewInit();
glGetError();
glGetError(); // clear the potential error from glewExperimental
});
Parent::customizeContext();
}