From e41f5617e975d6e4ac99fa480138c222dd5168ff Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 29 Jan 2019 09:54:17 -0800 Subject: [PATCH] fix color space --- libraries/entities-renderer/src/RenderableShapeEntityItem.cpp | 4 ++-- libraries/render-utils/src/RenderPipelines.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp index 192c6cfd49..151244448a 100644 --- a/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableShapeEntityItem.cpp @@ -256,7 +256,7 @@ void ShapeEntityRenderer::doRender(RenderArgs* args) { batch.setModelTransform(_renderTransform); // use a transform with scale, rotation, registration point and translation materials = _materials["0"]; auto& schema = materials.getSchemaBuffer().get(); - outColor = glm::vec4(schema._albedo, schema._opacity); + outColor = glm::vec4(ColorUtils::tosRGBVec3(schema._albedo), schema._opacity); outColor = EntityRenderer::calculatePulseColor(outColor, _pulseProperties, _created); if (_procedural.isReady()) { outColor = _procedural.getColor(outColor); @@ -309,7 +309,7 @@ scriptable::ScriptableModelBase ShapeEntityRenderer::getScriptableModel() { result.appendMaterials(_materials); auto materials = _materials.find("0"); if (materials != _materials.end()) { - vertexColor = materials->second.getSchemaBuffer().get()._albedo; + vertexColor = ColorUtils::tosRGBVec3(materials->second.getSchemaBuffer().get()._albedo); } } if (auto mesh = geometryCache->meshFromShape(geometryShape, vertexColor)) { diff --git a/libraries/render-utils/src/RenderPipelines.cpp b/libraries/render-utils/src/RenderPipelines.cpp index 07dc683719..b79d9ab0a6 100644 --- a/libraries/render-utils/src/RenderPipelines.cpp +++ b/libraries/render-utils/src/RenderPipelines.cpp @@ -319,7 +319,7 @@ void batchSetter(const ShapePipeline& pipeline, gpu::Batch& batch, RenderArgs* a graphics::MultiMaterial::Schema schema; graphics::MaterialKey schemaKey; - schema._albedo = vec3(1.0f); + schema._albedo = ColorUtils::sRGBToLinearVec3(vec3(1.0f)); schema._opacity = 1.0f; schema._metallic = 0.1f; schema._roughness = 0.9f;