wiColor refactor

This commit is contained in:
turanszkij
2018-11-14 19:15:16 +00:00
parent 2ff8549c34
commit 78e4a9d16b
23 changed files with 243 additions and 279 deletions
+4 -1
View File
@@ -254,7 +254,10 @@ MaterialWindow::MaterialWindow(wiGUI* gui) : GUI(gui)
colorPicker->OnColorChanged([&](wiEventArgs args) {
MaterialComponent* material = wiRenderer::GetScene().materials.GetComponent(entity);
if (material != nullptr)
material->SetBaseColor(XMFLOAT4(powf(args.color.x, 1.f / 2.2f), powf(args.color.y, 1.f / 2.2f), powf(args.color.z, 1.f / 2.2f), material->GetOpacity()));
{
XMFLOAT3 col = args.color.toFloat3();
material->SetBaseColor(XMFLOAT4(powf(col.x, 1.f / 2.2f), powf(col.y, 1.f / 2.2f), powf(col.z, 1.f / 2.2f), material->GetOpacity()));
}
});
materialWindow->AddWidget(colorPicker);