bug fix
parent
fb107870c2
commit
cdf9ec3c9c
|
@ -91,7 +91,7 @@ void PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTransform transfo
|
||||||
//qDebug() << leafLayer<<"------" << painterPath;
|
//qDebug() << leafLayer<<"------" << painterPath;
|
||||||
// transform to -1£¬ 1
|
// transform to -1£¬ 1
|
||||||
QTransform trans;
|
QTransform trans;
|
||||||
double maxLen = (std::max(bound.width(), bound.height()) + 2 * maxWidth) * 1.00001 / 2;
|
double maxLen = (std::max(bound.width(), bound.height()) + 2 * maxWidth) * 1.0001 / 2;
|
||||||
//qDebug() << maxLen << bound;
|
//qDebug() << maxLen << bound;
|
||||||
trans.scale(1 / maxLen, 1 / maxLen);
|
trans.scale(1 / maxLen, 1 / maxLen);
|
||||||
trans.translate(-bound.center().x(), -bound.center().y());
|
trans.translate(-bound.center().x(), -bound.center().y());
|
||||||
|
|
|
@ -339,30 +339,30 @@ void RendererGLWidget::paintGL()
|
||||||
if (model != nullptr)
|
if (model != nullptr)
|
||||||
model->draw();
|
model->draw();
|
||||||
|
|
||||||
plainProgramPtr->bind();
|
//plainProgramPtr->bind();
|
||||||
plainProgramPtr->setUniformValue("projection", projection);
|
//plainProgramPtr->setUniformValue("projection", projection);
|
||||||
plainProgramPtr->setUniformValue("view", view);
|
//plainProgramPtr->setUniformValue("view", view);
|
||||||
plainProgramPtr->setUniformValue("albedo", 0.5f, 0.5f, 0.5f);
|
//plainProgramPtr->setUniformValue("albedo", 0.5f, 0.5f, 0.5f);
|
||||||
QMatrix4x4 model;
|
//QMatrix4x4 model;
|
||||||
int nrRows = 7, nrColumns = 7;
|
//int nrRows = 7, nrColumns = 7;
|
||||||
float spacing = 2.5;
|
//float spacing = 2.5;
|
||||||
for (int row = 0; row < nrRows; ++row)
|
//for (int row = 0; row < nrRows; ++row)
|
||||||
{
|
//{
|
||||||
plainProgramPtr->setUniformValue("metallic", (float)row / (float)nrRows);
|
// plainProgramPtr->setUniformValue("metallic", (float)row / (float)nrRows);
|
||||||
for (int col = 0; col < nrColumns; ++col)
|
// for (int col = 0; col < nrColumns; ++col)
|
||||||
{
|
// {
|
||||||
plainProgramPtr->setUniformValue("roughness", glm::clamp((float)col / (float)nrColumns, 0.05f, 1.0f));
|
// plainProgramPtr->setUniformValue("roughness", glm::clamp((float)col / (float)nrColumns, 0.05f, 1.0f));
|
||||||
|
|
||||||
model.setToIdentity();
|
// model.setToIdentity();
|
||||||
model.scale(10);
|
// model.scale(10);
|
||||||
model.translate(QVector3D((float)(col - (nrColumns / 2)) * spacing,
|
// model.translate(QVector3D((float)(col - (nrColumns / 2)) * spacing,
|
||||||
(float)(row - (nrRows / 2)) * spacing + 20,
|
// (float)(row - (nrRows / 2)) * spacing + 20,
|
||||||
-2.0f));
|
// -2.0f));
|
||||||
plainProgramPtr->setUniformValue("model", model);
|
// plainProgramPtr->setUniformValue("model", model);
|
||||||
IblUtils::renderSphere(glFunc);
|
// IblUtils::renderSphere(glFunc);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
plainProgramPtr->release();
|
//plainProgramPtr->release();
|
||||||
|
|
||||||
pageIdDownsampleProgramPtr->bind();
|
pageIdDownsampleProgramPtr->bind();
|
||||||
gl->BindImageTexture(3, gbuffers[4], 0, GL_FALSE, 0, GL_READ_WRITE, GL_RG16UI);
|
gl->BindImageTexture(3, gbuffers[4], 0, GL_FALSE, 0, GL_READ_WRITE, GL_RG16UI);
|
||||||
|
|
Loading…
Reference in New Issue