From 863280300e5d52308f8df946185b80ea4e4d54a1 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 5 May 2015 22:37:00 +0200 Subject: [PATCH] Fix pickMeshList incorrect arguments --- libraries/render-utils/src/Model.cpp | 16 ++++++++-------- libraries/render-utils/src/Model.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index a022151c7d..b966820517 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1906,13 +1906,13 @@ void Model::endScene(RenderMode mode, RenderArgs* args) { opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, false, true, false, true, false, args); opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, false, true, true, false, false, args); opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, false, true, true, true, false, args); - + opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, true, false, false, false, false, args); opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, true, false, true, false, false, args); opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, true, true, false, false, false, args); opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, true, true, true, false, false, args); - opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, true, true, true, true, true, args); + opaqueMeshPartsRendered += renderMeshesForModelsInScene(batch, mode, false, DEFAULT_ALPHA_THRESHOLD, false, false, false, false, true, args); // render translucent meshes afterwards { @@ -2044,7 +2044,7 @@ bool Model::renderInScene(float alpha, RenderArgs* args) { updateGeometry(); simulate(0.0, true); } - + renderSetup(args); _modelsInScene.push_back(this); return true; @@ -2084,7 +2084,7 @@ void Model::segregateMeshGroups() { if (wantDebug) { qCDebug(renderutils) << "materialID:" << materialID << "parts:" << mesh.parts.size(); } - + RenderKey key(translucentMesh, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe()); // reuse or create the bucket corresponding to that key and insert the mesh as unsorted @@ -2101,13 +2101,13 @@ void Model::segregateMeshGroups() { _meshGroupsKnown = true; } -QVector* Model::pickMeshList(bool translucent, float alphaThreshold, bool hasLightmap, bool hasTangents, bool hasSpecular, bool isSkinned) { +QVector* Model::pickMeshList(bool translucent, float alphaThreshold, bool hasLightmap, bool hasTangents, bool hasSpecular, bool isSkinned, bool isWireframe) { PROFILE_RANGE(__FUNCTION__); // depending on which parameters we were called with, pick the correct mesh group to render QVector* whichList = NULL; - RenderKey key(translucent, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe()); + RenderKey key(translucent, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe); auto bucket = _renderBuckets.find(key.getRaw()); if (bucket != _renderBuckets.end()) { @@ -2155,7 +2155,7 @@ int Model::renderMeshesForModelsInScene(gpu::Batch& batch, RenderMode mode, bool Locations* locations = nullptr; foreach(Model* model, _modelsInScene) { - QVector* whichList = model->pickMeshList(translucent, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned); + QVector* whichList = model->pickMeshList(translucent, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe); if (whichList) { QVector& list = *whichList; if (list.size() > 0) { @@ -2181,7 +2181,7 @@ int Model::renderMeshes(gpu::Batch& batch, RenderMode mode, bool translucent, fl int meshPartsRendered = 0; //Pick the mesh list with the requested render flags - QVector* whichList = pickMeshList(translucent, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned); + QVector* whichList = pickMeshList(translucent, alphaThreshold, hasLightmap, hasTangents, hasSpecular, isSkinned, isWireframe); if (!whichList) { return 0; } diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h index 83d52d390c..9aa856312d 100644 --- a/libraries/render-utils/src/Model.h +++ b/libraries/render-utils/src/Model.h @@ -375,7 +375,7 @@ private: bool forceRenderMeshes = false); void setupBatchTransform(gpu::Batch& batch, RenderArgs* args); - QVector* pickMeshList(bool translucent, float alphaThreshold, bool hasLightmap, bool hasTangents, bool hasSpecular, bool isSkinned); + QVector* pickMeshList(bool translucent, float alphaThreshold, bool hasLightmap, bool hasTangents, bool hasSpecular, bool isSkinned, bool isWireframe); int renderMeshesFromList(QVector& list, gpu::Batch& batch, RenderArgs::RenderMode mode, bool translucent, float alphaThreshold, RenderArgs* args, Locations* locations,