Merge pull request #14794 from SamGondelman/colors

Case 20888: Fix color space
This commit is contained in:
Jeff Clinton 2019-01-30 09:09:07 -08:00 committed by GitHub
commit 3b84580e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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<graphics::MultiMaterial::Schema>();
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<graphics::MultiMaterial::Schema>()._albedo;
vertexColor = ColorUtils::tosRGBVec3(materials->second.getSchemaBuffer().get<graphics::MultiMaterial::Schema>()._albedo);
}
}
if (auto mesh = geometryCache->meshFromShape(geometryShape, vertexColor)) {

View file

@ -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;