From 8409119ad0517d6c6bcbbe00b3175a3780f55705 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Fri, 21 Jun 2019 12:58:49 -0700 Subject: [PATCH] possible fix for black shape issue --- .../entities-renderer/src/RenderableShapeEntityItem.cpp | 6 +++--- libraries/entities-renderer/src/RenderableShapeEntityItem.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp index 7faebfdf56..ec1c890583 100644 --- a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp @@ -70,7 +70,7 @@ bool ShapeEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPoin return true; } - if (_color != entity->getColor()) { + if (_color != toGlm(entity->getColor())) { return true; } if (_alpha != entity->getAlpha()) { @@ -130,12 +130,12 @@ void ShapeEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPoint } }); - glm::u8vec3 color = entity->getColor(); + glm::vec3 color = toGlm(entity->getColor()); float alpha = entity->getAlpha(); if (_color != color || _alpha != alpha) { _color = color; _alpha = alpha; - _material->setAlbedo(toGlm(_color)); + _material->setAlbedo(color); _material->setOpacity(_alpha); auto materials = _materials.find("0"); diff --git a/libraries/entities-renderer/src/RenderableShapeEntityItem.h b/libraries/entities-renderer/src/RenderableShapeEntityItem.h index c9fd4801d5..6e4b05f716 100644 --- a/libraries/entities-renderer/src/RenderableShapeEntityItem.h +++ b/libraries/entities-renderer/src/RenderableShapeEntityItem.h @@ -43,7 +43,7 @@ private: PulsePropertyGroup _pulseProperties; std::shared_ptr _material { std::make_shared() }; - glm::u8vec3 _color; + glm::vec3 _color { NAN }; float _alpha; glm::vec3 _position;