mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
hmmm not working
This commit is contained in:
parent
a31b09b204
commit
dbc3ae3793
4 changed files with 8 additions and 11 deletions
|
@ -53,7 +53,7 @@ bool ShapeEntityRenderer::needsRenderUpdate() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto mat = _materials.find("0");
|
auto mat = _materials.find("0");
|
||||||
if (mat != _materials.end() && (mat->second.needsUpdate() || mat->second.areTexturesLoading())) {
|
if (mat != _materials.end() && mat->second.shouldUpdate()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ bool ShapeEntityRenderer::useMaterialPipeline(const graphics::MultiMaterial& mat
|
||||||
|
|
||||||
ShapeKey ShapeEntityRenderer::getShapeKey() {
|
ShapeKey ShapeEntityRenderer::getShapeKey() {
|
||||||
auto mat = _materials.find("0");
|
auto mat = _materials.find("0");
|
||||||
if (mat != _materials.end() && (mat->second.needsUpdate() || mat->second.areTexturesLoading())) {
|
if (mat != _materials.end() && mat->second.shouldUpdate()) {
|
||||||
RenderPipelines::updateMultiMaterial(mat->second);
|
RenderPipelines::updateMultiMaterial(mat->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -456,15 +456,12 @@ public:
|
||||||
graphics::MaterialKey getMaterialKey() const { return graphics::MaterialKey(_schemaBuffer.get<graphics::MultiMaterial::Schema>()._key); }
|
graphics::MaterialKey getMaterialKey() const { return graphics::MaterialKey(_schemaBuffer.get<graphics::MultiMaterial::Schema>()._key); }
|
||||||
const gpu::TextureTablePointer& getTextureTable() const { return _textureTable; }
|
const gpu::TextureTablePointer& getTextureTable() const { return _textureTable; }
|
||||||
|
|
||||||
bool needsUpdate() const { return _needsUpdate; }
|
|
||||||
void setNeedsUpdate(bool needsUpdate) { _needsUpdate = needsUpdate; }
|
void setNeedsUpdate(bool needsUpdate) { _needsUpdate = needsUpdate; }
|
||||||
|
|
||||||
void setTexturesLoading(bool value) { _texturesLoading = value; }
|
void setTexturesLoading(bool value) { _texturesLoading = value; }
|
||||||
bool areTexturesLoading() const { return _texturesLoading; }
|
|
||||||
|
|
||||||
bool isInitialized() const { return _initialized; }
|
|
||||||
void setInitialized() { _initialized = true; }
|
void setInitialized() { _initialized = true; }
|
||||||
|
|
||||||
|
bool shouldUpdate() const { return !_initialized || _needsUpdate || _texturesLoading; }
|
||||||
|
|
||||||
int getTextureCount() const { calculateMaterialInfo(); return _textureCount; }
|
int getTextureCount() const { calculateMaterialInfo(); return _textureCount; }
|
||||||
size_t getTextureSize() const { calculateMaterialInfo(); return _textureSize; }
|
size_t getTextureSize() const { calculateMaterialInfo(); return _textureSize; }
|
||||||
bool hasTextureInfo() const { return _hasCalculatedTextureInfo; }
|
bool hasTextureInfo() const { return _hasCalculatedTextureInfo; }
|
||||||
|
|
|
@ -83,7 +83,7 @@ void MeshPartPayload::updateKey(const render::ItemKey& key) {
|
||||||
ItemKey::Builder builder(key);
|
ItemKey::Builder builder(key);
|
||||||
builder.withTypeShape();
|
builder.withTypeShape();
|
||||||
|
|
||||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
if (_drawMaterials.shouldUpdate()) {
|
||||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ void ModelMeshPartPayload::updateKey(const render::ItemKey& key) {
|
||||||
builder.withDeformed();
|
builder.withDeformed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
if (_drawMaterials.shouldUpdate()) {
|
||||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, PrimitiveMode pr
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
if (_drawMaterials.shouldUpdate()) {
|
||||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -735,7 +735,7 @@ void RenderPipelines::bindMaterials(graphics::MultiMaterial& multiMaterial, gpu:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!multiMaterial.isInitialized() || multiMaterial.needsUpdate() || multiMaterial.areTexturesLoading()) {
|
if (multiMaterial.shouldUpdate()) {
|
||||||
updateMultiMaterial(multiMaterial);
|
updateMultiMaterial(multiMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue