optimizations to RenderableModelEntityItem::render()
Showing the changes to libraries/render-utils/src/Model.cpp (1 of 7 files). Show all
Unified · Split
| @@ -54,6 +54,7 @@ static int modelPointerTypeId = qRegisterMetaType<QPointer<Model> >(); · 53 unmodified lines | ||
| 54 | 54 | static int weakNetworkGeometryPointerTypeId = qRegisterMetaType<QWeakPointer<NetworkGeometry> >(); |
| 55 | 55 | static int vec3VectorTypeId = qRegisterMetaType<QVector<glm::vec3> >(); |
| 56 | 56 | float Model::FAKE_DIMENSION_PLACEHOLDER = -1.0f; |
| 57 | +#define HTTP_INVALID_COM "http://invalid.com" | |
| 57 | 58 | |
| 58 | 59 | Model::Model(RigPointer rig, QObject* parent) : |
| 59 | 60 | QObject(parent), |
| @@ -67,7 +68,8 @@ Model::Model(RigPointer rig, QObject* parent) : · 7 unmodified lines | ||
| 67 | 68 | _cauterizeBones(false), |
| 68 | 69 | _lodDistance(0.0f), |
| 69 | 70 | _pupilDilation(0.0f), |
| 70 | − _url("http://invalid.com"), | |
| 71 | + _url(HTTP_INVALID_COM), | |
| 72 | + _urlAsString(HTTP_INVALID_COM), | |
| 71 | 73 | _isVisible(true), |
| 72 | 74 | _blendNumber(0), |
| 73 | 75 | _appliedBlendNumber(0), |
| @@ -181,17 +183,12 @@ void Model::RenderPipelineLib::initLocations(gpu::ShaderPointer& program, Model: · 107 unmodified lines | ||
| 181 | 183 | locations.texcoordMatrices = program->getUniforms().findLocation("texcoordMatrices"); |
| 182 | 184 | locations.emissiveParams = program->getUniforms().findLocation("emissiveParams"); |
| 183 | 185 | locations.glowIntensity = program->getUniforms().findLocation("glowIntensity"); |
| 184 | − | |
| 185 | 186 | locations.normalFittingMapUnit = program->getTextures().findLocation("normalFittingMap"); |
| 186 | − | |
| 187 | 187 | locations.specularTextureUnit = program->getTextures().findLocation("specularMap"); |
| 188 | 188 | locations.emissiveTextureUnit = program->getTextures().findLocation("emissiveMap"); |
| 189 | − | |
| 190 | 189 | locations.materialBufferUnit = program->getBuffers().findLocation("materialBuffer"); |
| 191 | 190 | locations.lightBufferUnit = program->getBuffers().findLocation("lightBuffer"); |
| 192 | − | |
| 193 | 191 | locations.clusterMatrices = program->getUniforms().findLocation("clusterMatrices"); |
| 194 | − | |
| 195 | 192 | locations.clusterIndices = program->getInputs().findLocation("inSkinClusterIndex"); |
| 196 | 193 | locations.clusterWeights = program->getInputs().findLocation("inSkinClusterWeight"); |
| 197 | 194 | } |
| @@ -1083,6 +1080,7 @@ void Model::setURL(const QUrl& url, const QUrl& fallback, bool retainCurrent, bo · 885 unmodified lines | ||
| 1083 | 1080 | invalidCalculatedMeshBoxes(); |
| 1084 | 1081 | |
| 1085 | 1082 | _url = url; |
| 1083 | + _urlAsString = _url.toString(); | |
| 1086 | 1084 | |
| 1087 | 1085 | onInvalidate(); |
| 1088 | 1086 | |
| @@ -1866,8 +1864,9 @@ void Model::pickPrograms(gpu::Batch& batch, RenderMode mode, bool translucent, f · 777 unmodified lines | ||
| 1866 | 1864 | batch._glUniform1f(locations->glowIntensity, DEFAULT_GLOW_INTENSITY); |
| 1867 | 1865 | } |
| 1868 | 1866 | |
| 1869 | − if ((locations->normalFittingMapUnit > -1)) { | |
| 1870 | − batch.setResourceTexture(locations->normalFittingMapUnit, DependencyManager::get<TextureCache>()->getNormalFittingTexture()); | |
| 1867 | + if ((locations->normalFittingMapUnit > -1)) { | |
| 1868 | + batch.setResourceTexture(locations->normalFittingMapUnit, | |
| 1869 | + DependencyManager::get<TextureCache>()->getNormalFittingTexture()); | |
| 1871 | 1870 | } |
| 1872 | 1871 | } |
| 1873 | 1872 | |